Source: libvirt
Version: 8.5.0-1
Severity: important
Tags: patch

Hi,

there were some recent changes in dh_installinit and dh_installsystemd
in now to handle removed but not purged packages. To read more on the
details you can check [1].

It seems, libvirt has some inlined, outdated copies of the generated
maintscript code from dh_installsystemd.
Since #994204 has been fixed, which was the reason to inline this code,
please reverting that change again.

The attached patch does that.

Thanks for considering.

Regards,
Michael


[1] https://salsa.debian.org/debian/debhelper/-/merge_requests/90
diff -Nru libvirt-8.5.0/debian/changelog libvirt-8.5.0/debian/changelog
--- libvirt-8.5.0/debian/changelog      2022-07-17 17:12:07.000000000 +0200
+++ libvirt-8.5.0/debian/changelog      2022-10-17 23:21:29.000000000 +0200
@@ -1,3 +1,11 @@
+libvirt (8.5.0-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Drop inlined copy of dh_installsystemd generated maintscript code now that
+    #994204 is fixed.
+
+ -- Michael Biebl <bi...@debian.org>  Mon, 17 Oct 2022 23:21:29 +0200
+
 libvirt (8.5.0-1) unstable; urgency=medium
 
   * [74b9b5c] New upstream version 8.5.0
diff -Nru libvirt-8.5.0/debian/libvirt-daemon-system.postinst 
libvirt-8.5.0/debian/libvirt-daemon-system.postinst
--- libvirt-8.5.0/debian/libvirt-daemon-system.postinst 2022-07-17 
17:12:07.000000000 +0200
+++ libvirt-8.5.0/debian/libvirt-daemon-system.postinst 2022-10-17 
23:20:51.000000000 +0200
@@ -162,202 +162,6 @@
 
 db_stop
 
-# Section copied verbatim from the output of dh_installsystemd/13.6
-#
-# Due to #994204, we are forced to handle systemd units ourselves to
-# avoid the restart of services/sockets which would result in VMs
-# being stopped or crashing.
-#
-# In order to do this, instead of calling dh_installsystemd in
-# debian/rules we take the output that those calls would generate
-# and hardcode it here, tweaking it as necessary to prevent the
-# problematic scenarios.
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'libvirtd.service' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'libvirtd.service'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'libvirtd.service' >/dev/null || true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'libvirtd.service' >/dev/null 
|| true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       if [ -z "${DPKG_ROOT:-}" ] && [ -d /run/systemd/system ]; then
-               systemctl --system daemon-reload >/dev/null || true
-               deb-systemd-invoke restart 'libvirtd.service' >/dev/null || true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'libvirt-guests.service' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'libvirt-guests.service'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'libvirt-guests.service' >/dev/null 
|| true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'libvirt-guests.service' 
>/dev/null || true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'virtlockd.service' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'virtlockd.service'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'virtlockd.service' >/dev/null || true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'virtlockd.service' >/dev/null 
|| true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'virtlogd.service' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'virtlogd.service'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'virtlogd.service' >/dev/null || true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'virtlogd.service' >/dev/null 
|| true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       if [ -z "${DPKG_ROOT:-}" ] && [ -d /run/systemd/system ]; then
-               systemctl --system daemon-reload >/dev/null || true
-               # We have already called 'reload' for virtlogd and virtlockd 
earlier if they were active
-               deb-systemd-invoke start 'libvirt-guests.service' 
'virtlockd.service' 'virtlogd.service' >/dev/null || true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'libvirtd-admin.socket' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'libvirtd-admin.socket'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'libvirtd-admin.socket' >/dev/null || 
true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'libvirtd-admin.socket' 
>/dev/null || true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'libvirtd-ro.socket' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'libvirtd-ro.socket'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'libvirtd-ro.socket' >/dev/null || 
true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'libvirtd-ro.socket' >/dev/null 
|| true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'libvirtd.socket' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'libvirtd.socket'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'libvirtd.socket' >/dev/null || true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'libvirtd.socket' >/dev/null || 
true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'virtlockd-admin.socket' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'virtlockd-admin.socket'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'virtlockd-admin.socket' >/dev/null 
|| true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'virtlockd-admin.socket' 
>/dev/null || true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'virtlockd.socket' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'virtlockd.socket'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'virtlockd.socket' >/dev/null || true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'virtlockd.socket' >/dev/null 
|| true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'virtlogd-admin.socket' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'virtlogd-admin.socket'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'virtlogd-admin.socket' >/dev/null || 
true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'virtlogd-admin.socket' 
>/dev/null || true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       # This will only remove masks created by d-s-h on package removal.
-       deb-systemd-helper unmask 'virtlogd.socket' >/dev/null || true
-
-       # was-enabled defaults to true, so new installations run enable.
-       if deb-systemd-helper --quiet was-enabled 'virtlogd.socket'; then
-               # Enables the unit on first installation, creates new
-               # symlinks on upgrades if the unit file has changed.
-               deb-systemd-helper enable 'virtlogd.socket' >/dev/null || true
-       else
-               # Update the statefile to add new symlinks (if any), which need 
to be
-               # cleaned up on purge. Also remove old symlinks.
-               deb-systemd-helper update-state 'virtlogd.socket' >/dev/null || 
true
-       fi
-fi
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = 
"abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
-       if [ -z "${DPKG_ROOT:-}" ] && [ -d /run/systemd/system ]; then
-               systemctl --system daemon-reload >/dev/null || true
-               deb-systemd-invoke start 'libvirtd-admin.socket' 
'libvirtd-ro.socket' 'libvirtd.socket' 'virtlockd-admin.socket' 
'virtlockd.socket' 'virtlogd-admin.socket' 'virtlogd.socket' >/dev/null || true
-       fi
-fi
-# End of section copied verbatim
-
 #DEBHELPER#
 
 exit 0
diff -Nru libvirt-8.5.0/debian/libvirt-daemon-system.postrm 
libvirt-8.5.0/debian/libvirt-daemon-system.postrm
--- libvirt-8.5.0/debian/libvirt-daemon-system.postrm   2022-07-17 
17:12:07.000000000 +0200
+++ libvirt-8.5.0/debian/libvirt-daemon-system.postrm   2022-10-17 
23:21:28.000000000 +0200
@@ -142,63 +142,6 @@
     ;;
 esac
 
-# Section copied verbatim from the output of dh_installsystemd/13.6
-#
-# Due to #994204, we are forced to handle systemd units ourselves to
-# avoid the restart of services/sockets which would result in VMs
-# being stopped or crashing.
-#
-# In order to do this, instead of calling dh_installsystemd in
-# debian/rules we take the output that those calls would generate
-# and hardcode it here, tweaking it as necessary to prevent the
-# problematic scenarios.
-if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
-       systemctl --system daemon-reload >/dev/null || true
-fi
-if [ "$1" = "remove" ]; then
-       if [ -x "/usr/bin/deb-systemd-helper" ]; then
-               deb-systemd-helper mask 'libvirtd-admin.socket' 
'libvirtd-ro.socket' 'libvirtd.socket' 'virtlockd-admin.socket' 
'virtlockd.socket' 'virtlogd-admin.socket' 'virtlogd.socket' >/dev/null || true
-       fi
-fi
-
-if [ "$1" = "purge" ]; then
-       if [ -x "/usr/bin/deb-systemd-helper" ]; then
-               deb-systemd-helper purge 'libvirtd-admin.socket' 
'libvirtd-ro.socket' 'libvirtd.socket' 'virtlockd-admin.socket' 
'virtlockd.socket' 'virtlogd-admin.socket' 'virtlogd.socket' >/dev/null || true
-               deb-systemd-helper unmask 'libvirtd-admin.socket' 
'libvirtd-ro.socket' 'libvirtd.socket' 'virtlockd-admin.socket' 
'virtlockd.socket' 'virtlogd-admin.socket' 'virtlogd.socket' >/dev/null || true
-       fi
-fi
-if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
-       systemctl --system daemon-reload >/dev/null || true
-fi
-if [ "$1" = "remove" ]; then
-       if [ -x "/usr/bin/deb-systemd-helper" ]; then
-               deb-systemd-helper mask 'libvirt-guests.service' 
'virtlockd.service' 'virtlogd.service' >/dev/null || true
-       fi
-fi
-
-if [ "$1" = "purge" ]; then
-       if [ -x "/usr/bin/deb-systemd-helper" ]; then
-               deb-systemd-helper purge 'libvirt-guests.service' 
'virtlockd.service' 'virtlogd.service' >/dev/null || true
-               deb-systemd-helper unmask 'libvirt-guests.service' 
'virtlockd.service' 'virtlogd.service' >/dev/null || true
-       fi
-fi
-if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
-       systemctl --system daemon-reload >/dev/null || true
-fi
-if [ "$1" = "remove" ]; then
-       if [ -x "/usr/bin/deb-systemd-helper" ]; then
-               deb-systemd-helper mask 'libvirtd.service' >/dev/null || true
-       fi
-fi
-
-if [ "$1" = "purge" ]; then
-       if [ -x "/usr/bin/deb-systemd-helper" ]; then
-               deb-systemd-helper purge 'libvirtd.service' >/dev/null || true
-               deb-systemd-helper unmask 'libvirtd.service' >/dev/null || true
-       fi
-fi
-# End of section copied verbatim
-
 #DEBHELPER#
 
 exit 0

Reply via email to