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

Re: daemon stop and start during upgrade



On Tue, Sep 11, 2007 at 08:06:42PM +0200, Patrick Schoenfeld wrote:
> Adeodato Simó schrieb:
> > Your init.d script should *not* exit with status non-zero if the daemon
> > was already stopped. You can do that either by passing --oknodo to
> > start-stop-daemon, or by checking by hand if the return status is 1.
> > *Not*, in any case, by appending "|| true", since that would hide the
> > case when a real errors occurs and the daemon can't be stopped.
> 
> Hm. If i think about this topic it appears to make sense to let
> invoke-rc.d not fail (I actually do it like this), but I'm asking myself
> the question why this is not formalized in the policy?

> It would be a pro to take this into the policy, wouldn't it?

It is 9.3.2:

|    The `init.d' scripts must ensure that they will behave sensibly if
|    invoked with `start' when the service is already running, or with
|    `stop' when it isn't, and that they don't kill unfortunately-named
|    user processes.  The best way to achieve this is usually to use
|    `start-stop-daemon'.


It's a very interesting question whether packages should inhibit
starting a daemon that wasn't running when it would otherwise have
been stopped.  I guess the current state of affairs is that a
manually-stopped daemon which is started at postinst time will cause a
message to be printed and the admin can stop it again if he wants.  I
think the ideal situation is that a manually-stopped daemon would
cause a message to be printed: "Not starting food: not stopped at
preinst time" in the same style of messages that are shown with
increasing consistency when things are not enabled in etc/default.

Justin



Reply to: