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

Bug#60979: What /etc/init.d/xxx restart does?

On Thu, Mar 23, 2000 at 04:39:47PM -0600, Manoj Srivastava wrote:
> >>"Radim" == Radim Kolar <hsn@cybermail.net> writes:
>  Radim> In section 3.3.2. is not clear what 'restart' does.
>  Radim> 1. restart=stop and start
>  Radim> 2. if service is running, stop it and start it, when is not
>  Radim> running, do not start it.
> [...]
>         I do agree that these two behaviours are valid, and are
>  required in some situations. What I do not have a handle on yet is
>  which is the more common case, and thus which should be the default
>  behavior. 
>         Either we needd restart+force-restart, or we need a
>  restart+maybe-restart. 

The main case (IMHO) where we need a `maybe-restart' is in postinst's
so that an upgrade doesn't restart a service that doesn't need to be

I personally think a more useful thing would be a "start-rc.d" that you
use a la:

	$ cat debian/postinst
	start-rc.d inetd restart

which will then call /etc/init.d/inetd restart iff inetd ought to be
started in whatever runlevel we're currently in.

This copes with people who disable a service by stopping it and deleting
the rc.d links (which isn't coped with atm, really), but not with people
who just stop a service. Note, though, that even with a `maybe-restart',
this wouldn't be coped with: portmap, for example, gets stopped in
the prerm and started in the postinst rather than just restarted in
the postinst.

start-rc.d could also `cd /' and clear the PATH and any other weird
environment variables, which would be a nice side benefit.

Note that start-rc.d would need to be provided by both dpkg and
file-rc. Sample implementations were posted to -devel last year or
so. Ummm, check:


maybe. The weblogs seem to be missing the mail I was actually thinking
of (although it's in the logs on master). Bizarre.


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

 ``The thing is: trying to be too generic is EVIL. It's stupid, it 
        results in slower code, and it results in more bugs.''
                                        -- Linus Torvalds

Attachment: pgpSz8Z0qO800.pgp
Description: PGP signature

Reply to: