Re: Service stopping in prerm considered harmful
Pierre THIERRY <email@example.com> writes:
> For the nth time, I have a package that dpkg is unable to remove because
> it tries to stop a service that either is already stopped (I didn't want
> it) or couldn't start at all. In the former case, the fix seems simple:
> start the service and remove the package. But sometimes starting the
> service may have undesirable outcomes on the system, or the stop action
> will fail in some way.
> In either case, when you can't get a successful stop action for the
> service init.d script, the package is impossible to remove without human
> action, and not a simple one, because you need to be able to hack the
> maintainer scripts or the init.d script.
> Shouldn't the maintainer script actually ensure that the service is not
> running, instead of just triggering the stop action and checking its
> exit code? Something like (it's pseudo-code, because the status action
> of init.d scripts prints text, it doesn't seem to give machine-friendly
I think the right solution to this is to require that the stop action not
fail when the daemon already isn't running. LSB requires this of init
scripts. I think we should as well. There may already be an open Policy
bug about this, along with the several bugs that say that we should follow
LSB in general.
Russ Allbery (firstname.lastname@example.org) <http://www.eyrie.org/~eagle/>