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

Service stopping in prerm considered harmful

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

# if it's running, stop it
if(status(service) == running) {
# if now it's still running, something's wrong
if(status(service) == running) {
	exit 1;
# proceed...

OpenPGP 0xD9D50D8A

Attachment: signature.asc
Description: Digital signature

Reply to: