in this case it installs "prerm-systemd-restart" which *only* stops the service in the prerm if $1 == "remove". The problem is a bit more subtle: As you can see in the prerm, there are *two* stanzas for "stop libvirt-guests.service". The first one is wrong, the second one is correct (if $1 == "remove") and comes from the explicit
call in debian/rules. However, the first one gets synthesized by cdbs' debhelper.mk, and unfortunately cdbs does not have a way to override the options per-service:
dh_installinit -p libvirt-bin --name=libvirt-guests --no-restart-on-upgrade -- defaults 29 71
dh_systemd_enable
dh_systemd_start -p libvirt-bin --restart-after-upgrade libvirt-bin.service
dh_systemd_start -p libvirt-bin --no-restart-on-upgrade libvirt-guests.service
[... the above is from the explicit debian/rules code ...]
dh_install -plibvirt-bin⎵⎵
dh_systemd_enable -plibvirt-bin⎵
dh_systemd_start -plibvirt-bin⎵
[... the above is from the implicit cdbs debhelper rules ...]
As debian/rules already has explicit calls for libvirt-bin's dh_systemd_start, I think the easiest fix is to completely disable the implicicly generated rules:
# we have explicit calls with different options per .service, disable
# autogenerated calls
DEB_DH_SYSTEMD_START_ARGS_libvirt-bin = --no-act
The original dh_systemd_start code is correct:
if ($dh{R_FLAG} || $dh{RESTART_ AFTER_UPGRADE} ) {
in this case it installs "prerm- systemd- restart" which *only* stops the service in the prerm if $1 == "remove". The problem is a bit more subtle: As you can see in the prerm, there are *two* stanzas for "stop libvirt- guests. service" . The first one is wrong, the second one is correct (if $1 == "remove") and comes from the explicit
dh_systemd_start -p libvirt-bin --no-restart- on-upgrade libvirt- guests. service
call in debian/rules. However, the first one gets synthesized by cdbs' debhelper.mk, and unfortunately cdbs does not have a way to override the options per-service:
$(if $(wildcard /usr/bin/ dh_systemd_ start), dh_systemd_ start -p$(cdbs_curpkg) $(call cdbs_expand_ curvar, DEB_DH_ SYSTEMD_ START_ARGS) )
this can also be seen in the build log:
dh_installinit -p libvirt-bin --name= libvirt- guests --no-restart- on-upgrade -- defaults 29 71 after-upgrade libvirt-bin.service on-upgrade libvirt- guests. service
dh_systemd_enable
dh_systemd_start -p libvirt-bin --restart-
dh_systemd_start -p libvirt-bin --no-restart-
[... the above is from the explicit debian/rules code ...]
dh_install -plibvirt-bin⎵⎵
dh_systemd_enable -plibvirt-bin⎵
dh_systemd_start -plibvirt-bin⎵
[... the above is from the implicit cdbs debhelper rules ...]
As debian/rules already has explicit calls for libvirt-bin's dh_systemd_start, I think the easiest fix is to completely disable the implicicly generated rules:
# we have explicit calls with different options per .service, disable SYSTEMD_ START_ARGS_ libvirt- bin = --no-act
# autogenerated calls
DEB_DH_