Re: init.d scripts: LSB and Debian policy
Hi,
On 13 Aug 2003, Thomas Hood wrote:
> > [LSB 1.9-pre snapshot]
> FYI: There is a wish (#203239) for policy to endorse a name for the
> action of restarting a service iff it is running. Names proposed
> have been "restart-if-running" and "restart" with second argument
> "running".
The "restart-if-running" is called "try-restart" in the gLSB 1.9 snapshot.
> > . running "reload" on a service already stopped or not running
> > The LSB says that these are successful while the DP says nothing about
> > this.
>
> You misquote the LSB (1.3). It says that running "restart" on a service
> already stopped or not running should be counted as a success.
Well, I am quoting the gLSB 1.9.0-20030812 snapshot:
http://www.linuxbase.org/spec/gLSB/gLSB/iniscrptact.html
"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
* running "reload" on a service already stopped or not running
* running "force-reload" on a service already stopped or not running"
> Trying to reload a service that is not running should result in
> a nonzero status, I believe.
Regarding the gLSB you would suggest then the exit code "7"? Compared with
the other exit codes a nought would be more in the spirit of the LSB, I
would think. If you have a strong opinion regarding reload/force-reload
and the exit code 0, can you write to lsb-discuss?
> > (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))
> Making this change would take a long time to accomplish. Sounds
> like something that should happen post-sarge.
I'm fine with that. ;-)
Tobias
Reply to: