[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

init.d scripts: LSB and Debian policy



Hello,

working with the Debian Policy 3.6.0 (and the init.d files conforming to
the DP) and working with the LSB standard (and LSB-conforming init.d
scripts), I really prefer the clearer, less-ambiguous Linux Standard Base
standard.
(http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
 http://www.linuxbase.org/spec/gLSB/gLSB/tocsysinit.html)

[The LSB requirements mentioned in this emails are for LSB applications
and not manditory for a LSB certificated distribution, nevertheless some
distributions, notably SuSE, started to use them for their own init.d
script.]


In particular:
- "status" is my mostly missed command since we moved from RedHat and SuSE
   to Debian Woody. Could this be added at least as optional command to DP?
   (The gLSB requires these)

- [DP] "force-reload -- cause the configuration to be reloaded if the
        service supports this, otherwise restart the service."
  [LSB 1.9-pre snapshot]
       "force-reload -- cause the configuration to be reloaded if the
        service supports this, otherwise restart the service
        if it is running"
  This solves the reload/restart ambiguity if the service is not running.

- The exit status codes in the DP are a bit unclear. Especially regarding
  . running "start" on a service already running
  . running "stop" on a service already stopped or not running
  . running "reload" on a service already stopped or not running
  The LSB says that these are successful while the DP says nothing about
  this. Some use Debian init.d scripts use start-stop-daemon with --nodook,
  others (a bit more) without.
  Adding to the DP that they should/shall return a "0" might make sense.

- (The [DP]   test -f program-executed-later-in-script || exit 0
       [LSB]  test -f program-executed-later-in-file || exit 5
   difference it also unfortunate (0=success, 5=program is not installed))


Since I find this part really cool and it doesn't hurd I'd like to see the
http://www.linuxbase.org/spec/gLSB/gLSB/initscrcomconv.html be used.
It is simply nice that a /usr/lib/lsb/install_initd script installs a
script at the right place (before/after the network has started etc.) and
that usually a good [Short-]Description (header) is provided.
Having those lines in the init.d scripts not only paves the path for a
later use of automatic ordering but makes it for administrators like me
easier to "steal" a debian init.d script and use it on other linux systems
(which use is sometimes needed).
How about adding to the DP that these "comment conventions for init
scripts" might/should/shall be used?


With best regards,

Tobias



Reply to: