[lsb-discuss] restart behavior (initscript)

Ademar de Souza Reis Jr. ademar at conectiva.com.br
Tue Aug 12 09:43:15 PDT 2003


On Tue, Aug 12, 2003 at 10:05:19AM -0500, Mark Hatle wrote:
> Ademar de Souza Reis Jr. wrote:
> >I agree that it could be atomic, and I'm about to change our internal
> >policy to *enforce* that behavior when possible.
> >
> >If it's a consensus, It would be nice to add a note like this to the "Init
> >Script Actions" document (sorry for not providing a patch):
> >
> >"A restart can be atomic, i.e. if the service can not be started after a
> >stop, a restart can return an error refusing to stop the service in the
> >first place."
> 
> It's great to set policies, but how on earth am I supposed to verify 
> that a service can't be started w/o trying to start it?  ;)

It's not suposed to be mandatory. It's just suposed to allow such
behavior. At least in OpenSSH sshd, you have the -t parameter:

"""
     -t      Test mode.  Only check the validity of the configuration file and
             sanity of the keys.  This is useful for updating sshd reliably as
             configuration options may change.
"""

I'm sure there are other cases as well.

> 
> Most daemons that I am aware of don't have a "will it run" option.  This 
> is why I previously indicated that my feelings are that restart should 
> stop, then start.  If the start doesn't succeed send an appropriate 
> error to the user.

As showed in previous messages, such a behavior is really useful for
critical services like sshd. So, I end up with two options:

1. Allow such behavior in restart
2. Create yet another kind of restart, like "restart-if-possible" :)

For sure I prefer (1).

> 
> If the clafication is to allow for daemons that have the ability to 
> predict if they can be restarted, then that is fine.. I don't 
> necessarily like the wording, but I can't come up with anything better.

That's the idea. :) The sentence is just something I came up without
spending much time on it.

A more verbose (and redundant) one:

"Optionally, a restart can be atomic, i.e. if it's possible to check if the
service will be started after being stopped (checking its configuration, for
example), the restart action can perform such test and return an error
refusing to stop the service in the first place if it detects it will not be
started after a stop. Such a behavior is useful for critical services, like
the ones who provide remote login."

The previous one:
"A restart can be atomic, i.e. if the service can not be started after a
stop, a restart can return an error refusing to stop the service in the
first place."

Best regards,

-- 
Ademar de Souza Reis Jr. <ademar at conectiva.com.br>

^[:wq!




More information about the lsb-discuss mailing list