[Pkg-sysvinit-devel] Bug#427889: skeleton "start" and "stop" return values not LSB compliant

Iñaki Baz Castillo ibc at aliax.net
Thu Jun 7 09:00:26 UTC 2007


Package: initscripts
Version: 2.86.ds1-38
Severity: normal



-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-4-xen-686 (SMP w/1 CPU core)
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages initscripts depends on:
ii  debianut 2.20.1                          Miscellaneous utilities specific t
ii  e2fsprog 1.39+1.40-WIP-2007.04.07+dfsg-2 ext2 file system utilities and lib
ii  libc6    2.5-10                          GNU C Library: Shared libraries
ii  lsb-base 3.1-23.1                        Linux Standard Base 3.1 init scrip
ii  mount    2.12r-19                        Tools for mounting and manipulatin
ii  sysvinit 2.86.ds1-38                     System-V-like utilities

Versions of packages initscripts recommends:
ii  psmisc                        22.5-1     Utilities that use the proc filesy

-- no debconf information



This bug is related to #426877:
  "dpkg: Option "--oknodo" should be the default behaviour for "start-stop-daemon" (LSB specs)"
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426877


Acording to the LSB specifications for init scripts [1]:

"For all other init-script actions, the init script shall return an exit
status of zero if the action was successful. Otherwise, the exit status
shall be non-zero, as defined below. In addition to straightforward
success, the following situations are also to be considered successful: 
- Restarting a service (instead of reloading it) with the force-reload
argument
- Running start on a service already running
- Running stop on a service already stopped or not running
- Running restart on a service already stopped or not running
- Running try-restart on a service already stopped or not running"


But the /etc/init.d/skeleton says:

    do_start()
    {
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
    
    do_stop()
    {
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred


They should return 0 when "start" even if the service was already running and return 0 when stoping it even it was already stopped.


I think the policy should change to be LSB compliant:

- "skeleton" script should incite the LSB behaviour.
- "start-stop-daemon" should use "--oknodo" but default (see bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426877).
- A lot of services in Debian not using skeleton or start-stop-daemon should make correct the return values according to LSB specs.



[1] LSB specifications about init script actions:
http://www.linux-foundation.org/spec/refspecs/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html




More information about the Pkg-sysvinit-devel mailing list