Comment 2 for bug 2051153

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

It really seems to be dh_installsystemd/13.6ubuntu1

You can quick compare this:
root@j-vm:~# grep mount /var/lib/dpkg/info/qemu-block-extra*
/var/lib/dpkg/info/qemu-block-extra.list:/lib/systemd/system/run-qemu.mount
/var/lib/dpkg/info/qemu-block-extra.md5sums:3cf5dc7461348db7d58b6b99b5878731 lib/systemd/system/run-qemu.mount
/var/lib/dpkg/info/qemu-block-extra.postinst: if deb-systemd-helper debian-installed 'run-qemu.mount'; then
/var/lib/dpkg/info/qemu-block-extra.postinst: deb-systemd-helper unmask 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postinst: if deb-systemd-helper --quiet was-enabled 'run-qemu.mount'; then
/var/lib/dpkg/info/qemu-block-extra.postinst: deb-systemd-helper enable 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postinst: deb-systemd-helper update-state 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postinst: deb-systemd-invoke $_dh_action 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postinst:# dh_installsystemd will not fully enable or start .mount units, but we want
/var/lib/dpkg/info/qemu-block-extra.postinst: systemctl enable 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postinst: deb-systemd-invoke start 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postrm: deb-systemd-helper mask 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postrm: deb-systemd-helper purge 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postrm: deb-systemd-helper unmask 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postrm:case $1 in (purge) if systemctl is-active -q run-qemu.mount; then systemctl stop run-qemu.mount || true; fi; rm -rf "/run/qemu";; esac
/var/lib/dpkg/info/qemu-block-extra.prerm: deb-systemd-invoke stop 'run-qemu.mount' >/dev/null || true

root@m-vm:~# grep mount /var/lib/dpkg/info/qemu-block-extra*
/var/lib/dpkg/info/qemu-block-extra.list:/lib/systemd/system/run-qemu.mount
/var/lib/dpkg/info/qemu-block-extra.md5sums:3cf5dc7461348db7d58b6b99b5878731 lib/systemd/system/run-qemu.mount
/var/lib/dpkg/info/qemu-block-extra.postinst:# dh_installsystemd will not fully enable or start .mount units, but we want
/var/lib/dpkg/info/qemu-block-extra.postinst: systemctl enable 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postinst: deb-systemd-invoke start 'run-qemu.mount' >/dev/null || true
/var/lib/dpkg/info/qemu-block-extra.postrm:case $1 in (purge) if systemctl is-active -q run-qemu.mount; then systemctl stop run-qemu.mount || true; fi; rm -rf "/run/qemu";; esac

The criticial bit is this line:
/var/lib/dpkg/info/qemu-block-extra.postinst:63: deb-systemd-invoke $_dh_action 'run-qemu.mount' >/dev/null || true

This is the full section:
# End automatically added section
# Automatically added by dh_installsystemd/13.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
        if [ -d /run/systemd/system ]; then
                systemctl --system daemon-reload >/dev/null || true
                if [ -n "$2" ]; then
                        _dh_action=restart
                else
                        _dh_action=start
                fi
                deb-systemd-invoke $_dh_action 'run-qemu.mount' >/dev/null || true
        fi
fi
# End automatically added section

So on "configure" (which is called on upgrade) this will call
  deb-systemd-invoke $_dh_action 'run-qemu.mount'
with
  _dh_action=restart

That is ... wrong
--no-restart-on-upgrade should prevent this, but doesn't