]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
postinst: handle masked units
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 13 Mar 2018 11:08:39 +0000 (12:08 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 13 Mar 2018 11:14:22 +0000 (12:14 +0100)
check if a unit is masked before starting/restarting/reloading it,
as else we get pretty ugly error messages during upgrade.

as "deb-systemd-helper --quiet was-enabled" differs from the
"systemctl is-enabled" behaviour, the former returns true for masked
units while the latter does not, we have to manually call systemctl,
circumventing the deb helper.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
debian/postinst

index 58736a15bea043a5f5e9b610d3793ddfd76d5c7e..4f8b158ed668790ae1bd6f06dd91674a35574253 100755 (executable)
@@ -71,7 +71,9 @@ case "$1" in
            else
                dh_action="start"
            fi
-           deb-systemd-invoke $dh_action "$unit"
+           if systemctl -q is-enabled "$unit"; then
+               deb-systemd-invoke $dh_action "$unit"
+           fi
        done
     fi