correctly removing systemd socket unit on package upgrade

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jan 11 08:38:43 GMT 2016


Hi all,

I building a deb package where I removed a socket unit file as I have no 
need for it anymore (to be exact, it mustn't be loaded anymore).

The question is now how to achieve a clean removal of this .socket file 
on a package upgrade, so that systemd doesn't tries to load it anymore 
and thus outputs:
> systemd[1]: Cannot add dependency job for unit watchdog-mux.socket, 
> ignoring: Unit watchdog-mux.socket failed to load: No such file or 
> directory.


Should I do it simply in postinst with something like:

> [...]
> configure)
>
> # remove the systemd watchdog-mux socket service
> # as watchdog-mux should handle this on it's own
> rm -f /etc/systemd/system/sockets.target.wants/watchdog-mux.socket


Or is there a cleaner (automated way) to achieve this?

best regards,
Thomas




More information about the Pkg-systemd-maintainers mailing list