[lsb-discuss] restart behavior (initscript)
fray at mvista.com
Wed Aug 6 20:09:20 PDT 2003
This is my interpretation of the spec.. so it very well may be wrong.
Ademar de Souza Reis Jr. wrote:
> I have doubts about the behavior of the restart
> action in the following scenarios:
> The daemon (sshd in my case) is misconfigured, so
> after stopping it, it will not (re)start.
> Can I check for the presence of this scenario and refuse
> to stop the service in the first place?
I'd consider this an undefined situation, however my feeling would be a
stop followed by an aborted start. The end result is the daemon has
been stopped and an error message/status code sent to the user.
> When the daemon (sshd again) receives a SIGHUP, it spawns a
> new copy of itself and kills the old parent process, but the
> childs are kept alive.
> Since there's a new parent process (the one who accepts
> new connections), can I consider this the same of a
This would be the "reload" case. It is my interpretation that a restart
must do exactly that. Stop the current daemon, and fully restart it.
The restart is useful if the physical binary changes, while a reload is
useful if the configuration changes.
> So, should the spec of the restart action be interpreted
> as a "start" followed by a "stop" or can I implement this
> kind of behavior?
That is how I have interpreted it, and how MontaVista init scripts work.
More information about the lsb-discuss