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

Re: daemon stop and start during upgrade



Felipe Sateler wrote:
>  - Behave sensibly when invoked with 'start' and already running
>  - Behave sensibly when invoked with 'stop' and not running

Ah.. yeah, that would be a possible interpretation of the policy. But
formalizing something as to "behave sensibly" is not really exact, cause
it is up to the reader how he interprets it. I do interpret it like this:

- Don't do nasty things with 'start' when already running (like killing
the firsts pidfiles, launching a seconds instance, etc.)
- Don't do nasty things with 'stop' when not running (like killing other
processes or changing something in the environment so it won't start the
next time).

I understand it so, that the third one is just there to describe it more
exactly. Because exiting with zero or non-zero has absolutely nothing to
do with "behaving sensibly". Actually returning a non-zero exit code is
the right thing to do, cause the action to stop a process _did_ fail,
because the process has not been running. Then again it would be
"sensible" not to let the upgrade process fail just because of this, but
i think thats far from the scope.

So in the end I agree that would be sensible to exit with 0, if the
process is not running, cause their might be different errors to occur
when stopping (even though I never met one), but that it would make
sense to describe this more clear in the policy.

Regards,

Patrick



Reply to: