Some updates to the sysvinit/initactions spec
Raymund Will and I discussed some contradictions in the Init Script
actions page, especially as it relates to exit codes, and so I've made
the following changes to that part of the spec. I don't think any of
these should be terribly controversial:
1) In the example test statement at the top of the file:
test -f program-executed-laster-in-file || exit 0
the "exit 0" has been changed to "exit 5" (program is not installed),
since that's the exit code specified by the later part of the spec.
2) In the list of situations which are to be considred successful (i.e.,
where the script should exit 0 in spite of there being a problem), I
have removed "reporting a problem with the 'status' option". First of
all, it's not clear what that means, and in the case where a program is
calling the init script with the "status" command, generally they are
explicitly testing the script for its exit code! So having it return 0
in all cases is not useful.
3) A new error code has been added:
7 program is not running
This is to be used when the reload action is given, and the service
isn't currently running.
4) The following paragraph was clarified. Old version:
Init files should try to account for unusual environment variable
settings (such as PATH, USER, LOGNAME, etc.) and continue to work if
reasonable.
New version:
Since init files may be run manually by a system administrator with
non-standard environment variable values for PATH, USER, LOGNAME,
etc. init files should not depend on the values of these environment
variables. They should set them to some known/default values if they
are needed.
5) In the installinit section, I've added the definition a new init.d
help script, /usr/lib/lsb/remove_initd, which is the converse of the
already existing /usr/lib/lsb/install_initd program/script. These
should be placed in a package's preuninstall and postinstall scripts,
respectively, so the distribution can do whatever init-script specific
installation or deinstallation might be necessary.
Any comments?
- Ted
Reply to: