dh_installsystemd - why deactivate services in postrm instead of prerm?

Daniele Nicolodi daniele at grinta.net
Wed Jun 27 18:39:05 BST 2018


I'm working on dh_installsystemduser, the equivalent of
dh_installsystemd for user instance systemd units. In the process I'm
trying to understand why dh_installsystemd works the way it does.

dh_installsystemd generates maintainer scripts code blocks that
deactivates installed unit. Why is it that done at postrm stage and not
at prerm stage? It seems that the later is the most common place where
to clean up on package removal, but I'm probably missing something.

Moving the deactivation to prerm would have the advantage that
dh_installsystemd would not have to keep track of units linked with
Also= in the Install section, because the unit file would still be around.

Thanks. Cheers,

More information about the Pkg-systemd-maintainers mailing list