Comment 7 for bug 1616422

Revision history for this message
Martin Pitt (pitti) wrote :

Thomas discovered another problem:

# apt-get remove colord
Removing colord (1.0.6-1) ...
Failed to issue method call: Unit colord.service not loaded.
dpkg: error processing package colord (--remove):
 subprocess installed pre-removal script returned error exit status 5
Failed to issue method call: Unit colord.service failed to load: No such file or directory. See system logs and 'systemctl status colord.service' for details.
Errors were encountered while processing:
 colord
E: Sub-process /usr/bin/dpkg returned an error code (1)

The autogenerated prerm has:

if [ -d /run/systemd/system ]; then
 deb-systemd-invoke stop colord.service >/dev/null
fi

This previously was a no-op in trusty as systemd never ran as pid 1 and thus /run/systemd/system does not exist. But it does exist now with the deputy init, and:

  - We added a patch to ignore units shipped by packages (in /lib/systemd/system)

 - colord *only* ships a systemd unit, not a corresponding SysV script (as it's D-Bus activated), and thus this uses dh_systemd_start/deb-systemd-invoke instead of dh_installinit/invoke-rc.d.

As we don't ever expect deb-systemd-invoke to actually do something on trusty, I propose to just replace it with a /bin/true symlink. This is more robust and more efficient than trying to detect within it if systemd runs as deputy init.