correctly removing systemd socket unit on package upgrade

Martin Pitt mpitt at debian.org
Fri May 6 23:52:18 BST 2016


Hello Thomas,

sorry for not seeing this earlier.

Thomas Lamprecht [2016-02-19 14:48 +0100]:
> I went for the post install script way which does effectively:
> > # remove the systemd watchdog mux socket service
> > # as watchdog-mux should handle this on it's own
> > if [ -L  /etc/systemd/system/sockets.target.wants/watchdog-mux.socket
> > ]; then
> >     rm -f /etc/systemd/system/sockets.target.wants/watchdog-mux.socket
> >     rm -f
> > /var/lib/systemd/deb-systemd-helper-enabled/sockets.target.wants/watchdog-mux.socket
> >     rm -f
> > /var/lib/systemd/deb-systemd-helper-enabled/watchdog-mux.socket.dsh-also
> >     systemctl daemon-reload
> > fi
> 
> Which also has it's issue if someone disabled the socket (with whichever
> reason he had) as I only check for the link, solvable through an better
> if condition, though.

I think it would be easier to do something like

  deb-systemd-helper disable watchdog-mux.socket
  deb-systemd-invoke stop watchdog-mux.socket

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)



More information about the Pkg-systemd-maintainers mailing list