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

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



On 23-Mar-00, 18:32 (CST), Anthony Towns <aj@azure.humbug.org.au> wrote: 
> 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
> restarted.

That may not work the way one would think it would, for a couple of
reasons. One is that I'd guess[1] that most upgrades use a "stop" in the
preinst and a "start" in the postinst (as you note later). The other is
that start-stop-daemon fails to stop a daemon whose executable has been
replaced - in other words, if you *want* the new version to be used, you
need to do (preinst: stop) and (postinst : start).


> I personally think a more useful thing would be a "start-rc.d" that you
> use a la:
> 
> 	$ cat debian/postinst
> 	#!/bin/sh
> 	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.

That seems a lot more valuable -- I've many other requests for that
functionality.

Steve

[1] on one of my machines, "grep 'init.d.*restart' /var/lib/dpkg/info/*postinst"
produced two hits (libc6 and netbase), while lots call "start". Hmm,
lots also call start-stop-daemon directly.

-- 
Steve Greenland <vmole@swbell.net>
(Please do not CC me on mail sent to this list; I subscribe to and read
every list I post to.)


Reply to: