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

Re: daemon stop and start during upgrade



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? Cause it is a
discuss able point if you think on it from this side: If nothing is
there to be stopped, then the requested action (say: stopping something)
obviously failed. But then again, we know that it does not make much
sense to let an upgrade fail, just because any admin stopped a daemon.
So rationale there are reasons for and against letting stop fail with a
non-zero exit code if there is nothing running, which could be stopped.
It would be a pro to take this into the policy, wouldn't it?

> If you wrote your init.d script from some template that advocates
> returning directly the exit status of start-stop-daemon without
> --oknodo, that template needs fixing.

Hm. It would be better to fix start-stop-daemon, cause policy does
*hardly* recommend to use it, while it does not have any recommends
about which template you may use. So it seems like not the template is
wrong, but the behavior of start-stop-daemon is wrong. Or not?
But then again it makes it hard to decide that, because policy does not
have a rule for this case.

Regards,
Patrick



Reply to: