[Bug 409425] Re: jaunty: init-functions causes init.d scripts to return wrong exit code on 'status' action

Steve Langasek steve.langasek at canonical.com
Wed May 15 08:23:07 UTC 2013


jaunty is long EOL, and this bug is fixed in karmic and above.  Closing.

** Changed in: lsb (Ubuntu)
       Status: Confirmed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to lsb in Ubuntu.
https://bugs.launchpad.net/bugs/409425

Title:
  jaunty: init-functions causes init.d scripts to return wrong exit code
  on 'status' action

Status in “lsb” package in Ubuntu:
  Fix Released

Bug description:
  Binary package hint: lsb

  Jaunty: /lib/lsb/init-functions causes init.d scripts to return wrong
  exit code on 'status' action  when the service is stopped.

  According to the LSB Specification [1], the status action should
  return an exit code of 3 (program is not running) when the service is
  stopped. However, this is not happening in Ubuntu Jaunty. When issuing
  the status action on a service that it's stopped, an exit code of 4
  (program or service status is unknown) is returned. However, this is
  not happening in Ubuntu Karmic.

  Examples:

  ######### OpenSSH #########

  #### Jaunty ####
  roaksoax at jaunty:~$ sudo /etc/init.d/ssh stop
   * Stopping OpenBSD Secure Shell server sshd                                                                                                                              [ OK ] 
  roaksoax at jaunty:~$ sudo /etc/init.d/ssh status; echo $?
   * sshd is not running
  4

  #### Karmic ####
  roaksoax at karmic:~/Desktop/karmic/fixes/lsb/lsb-4.0$ sudo /etc/init.d/ssh stop
   * Stopping OpenBSD Secure Shell server sshd                                                                                                                              [ OK ] 
  roaksoax at karmic:~/Desktop/karmic/fixes/lsb/lsb-4.0$ sudo /etc/init.d/ssh status; echo $?
   * sshd is not running
  3

  ######### Lighttpd #########

  #### Jaunty ####
  roaksoax at jaunty:~$ sudo /etc/init.d/lighttpd stop
   * Stopping web server lighttpd                                                                                                                                           [ OK ] 
  roaksoax at jaunty:~$ sudo /etc/init.d/lighttpd status; echo $?
   * lighttpd is not running
  4

  #### Karmic #####
  roaksoax at karmic:~/Desktop/karmic/fixes/lsb/lsb-4.0$ sudo /etc/init.d/lighttpd stop
   * Stopping web server lighttpd                                                                                                                                           [ OK ] 
  roaksoax at karmic:~/Desktop/karmic/fixes/lsb/lsb-4.0$ sudo /etc/init.d/lighttpd status; echo $?
   * lighttpd is not running
  3

  ######### Squid #########

  #### Jaunty ####
  roaksoax at jaunty:~$ sudo /etc/init.d/squid stop
   * Stopping Squid HTTP proxy squid                                                                                                                                        [ OK ] 
  roaksoax at jaunty:~$ sudo /etc/init.d/squid status; echo $?
   * squid is not running
  4

  #### Karmic ####
  roaksoax at karmic:~/Desktop/karmic/fixes/lsb/lsb-4.0$ sudo /etc/init.d/squid stop
   * Stopping Squid HTTP proxy squid                                                                                                                                        [ OK ] 
  roaksoax at karmic:~/Desktop/karmic/fixes/lsb/lsb-4.0$ sudo /etc/init.d/squid status; echo $?
   * squid is not running
  3

  
  After some research, I've identified that this bug is due to the fact that the /lib/lsb/init-functions script in karmic is different from the one in Jaunty. This karmic script includes changes that fixes this.  (Please see init-functions.diff, which shows the differences between the init-functions script in jaunty with the one in karmic)

  Something I've done to test this, is that I've replaced the "init-
  functions" script (/lib/lsb/init-functions) in Jaunty, with the one
  provided in the Karmic package. By doing so, this was fixed and the
  init scripts returned the exit code 3 instead of 4.

  [1]: http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-
  Core-generic/iniscrptact.html

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/409425/+subscriptions




More information about the foundations-bugs mailing list