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

Re: RFC: initscript policy proposal

On Wed, Nov 01, 2000 at 10:26:33PM -0200, Henrique M Holschuh wrote:
> > > > I propose that instead of "restarts converted to stops" we just go with
> > > > "restarts ignored". I realize that this would cause the new version of
> > > I spent some time thinking about that, and I decided that 'stop' was the
> > > safer approach, as it is very unlikely that a mission-critical component
> > The ignore option is probably better. If the maintainer wants to force
> > a stop (if the previous daemon will misbehave if its left running after
> > the new daemon is installed), it can be done by saying `/etc/init.d/foo
> > stop'. OTOH, having the stop only happen when it's expected to be running
> > isn't possible to fake.
> The new code (not posted yet) tries a maybe-restart, and if that fails, a
> stop. This is a bit different, but closer to the invoke-rc.d stop ; [...]
> I am worried about packages which do /etc/init.d/foo restart when foo isn't
> even a service they provide. For those situations, stop seems to me like a
> safer *default* behaviour than ignoring the request. The service is given a
> fair chance (in the new code) to avoid a stop if out-of-runlevel, it just
> needs to implement maybe-restart.

This could be done with:

	if [ -e /etc/init.d/foo ]; then
		/etc/init.d/foo stop
		invoke-rc.d foo start

> Could someone exemplify a situation where ignore would be safer? I'd need
> only to change restart to maybe-restart, then. 

You've got the following questions:

	Is it "meant" to be running? (as far as the current runlevel is

	Is it *actually* running? (is the daemon executing)

If it's meant to be running and is, that's straightforward to cope with it.
If it's not meant to be running, and isn't, that's straightforward too.

If it's not meant to be running, but is anyway, there are three
(reasonable) options:

	* leave it running as is (don't upgrade)
	* stop it, restart it
	* stop it

If it's meant to be running but isn't, there are two options:

	* leave it alone (don't start it)
	* start the new one

Probably different things are appropriate in different situations. Having as
many of them be possible is probably good, too.


Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/>
I don't speak for anyone save myself. GPG signed mail preferred.

  ``We reject: kings, presidents, and voting.
                 We believe in: rough consensus and working code.''
                                      -- Dave Clark

Attachment: pgpP4HbaP0Fuq.pgp
Description: PGP signature

Reply to: