postinst: handle masked units

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>
This commit is contained in:
Thomas Lamprecht 2018-03-13 12:08:39 +01:00
parent c2e814237c
commit 78bf2ea277

4
debian/postinst vendored
View File

@ -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