Comment 32 for bug 1913421

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

Updates already added for a new iteration:
- Fixed the version comparisons in the postinst (worked, but was wrong and could cause issues in later cross upgrades)
- Fixed the missing negation in the check if the target is no-exec (prevented saving of modules)

Info:
- the F/B postrm does purge service on purge (ok)
- the F/B postrm does mask the service on remove (ok - no conflict as it will only save the state)

Current remaning issue is the stopping on remove.
That is due to prerm - in Bionic by dh_*_start/-_enable handling by dh_systemd_start/11.1.6ubuntu2 and Focal by dh_installsystemd/12.10ubuntu1.
They stop the mount unit in prerm like:

# Automatically added by dh_systemd_start/11.1.6ubuntu2
if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
        deb-systemd-invoke stop 'run-qemu.mount' >/dev/null || true
fi
# End automatically added section

The old dh tools did neither detect a mount unit as such and handled it differently to other services, nor did it provide a means to no-stop-on-remove. I'm afraid I need to convert the generated snippets to explicit sections in the postinst files.