]> git.proxmox.com Git - ifupdown-pve.git/commitdiff
d/postrm: avoid purging/masking networking.service
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 5 Oct 2022 20:27:23 +0000 (22:27 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 5 Oct 2022 20:46:03 +0000 (22:46 +0200)
Proxmox projects are expecting one of ifupdown or ifupdown2 anyway,
so the networking.service must always exist. This makes switching
from ifupdown to ifupdown2 more convenient.

Note that it doesn't fixes the systems that already switched, but
still have a lingering ifupdown conf available, They won't get this
update, and if they do a (config) purge of the (partially) removed
ifupdown it will still disable networking.service - we need to handle
that somewhere else (e.g., sed the ifupdown postrm in ifupdown2 preinst)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/debian/postrm

index 24dc249a78d3c5be17aae7c16cf7fb20effe7b17..88805d34aa7ab78dd29efaee4a68e7a9c51712e4 100644 (file)
@@ -15,6 +15,11 @@ case "$1" in
     ;;
 esac
 
+# [Proxmox]: Manually copy over DEBHELPER to avoid purging networking.service
+# on removal/purge to improve UX on switch to ifupdown2.
+#
+# TODO: Check for required updates once a upstream update gets pulled in
+
 # Automatically added by dh_installinit/13.5.2~bpo11+1
 if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = "purge" ] ; then
        update-rc.d networking remove >/dev/null
@@ -60,19 +65,5 @@ if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
        systemctl --system daemon-reload >/dev/null || true
 fi
 # End automatically added section
-# Automatically added by dh_installsystemd/13.5.2~bpo11+1
-if [ "$1" = "remove" ]; then
-       if [ -x "/usr/bin/deb-systemd-helper" ]; then
-               deb-systemd-helper mask 'networking.service' >/dev/null || true
-       fi
-fi
-
-if [ "$1" = "purge" ]; then
-       if [ -x "/usr/bin/deb-systemd-helper" ]; then
-               deb-systemd-helper purge 'networking.service' >/dev/null || true
-               deb-systemd-helper unmask 'networking.service' >/dev/null || true
-       fi
-fi
-# End automatically added section