[pve-devel] applied: [PATCH manager 1/2] postinst: handle masked units
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue Mar 13 12:20:48 CET 2018
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 at proxmox.com>
Acked-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
debian/postinst | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/debian/postinst b/debian/postinst
index 58736a15..4f8b158e 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -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
--
2.14.2
More information about the pve-devel
mailing list