[pve-devel] [PATCH firewall 1/6] fix #1319: don't fail postinst with masked service
Fabian Grünbichler
f.gruenbichler at proxmox.com
Thu Mar 8 13:33:51 CET 2018
by using "try-reload-or-restart" instead of "reload-or-restart"
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
debian/postinst | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/debian/postinst b/debian/postinst
index 4077183..0e6b7b2 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -2,11 +2,21 @@
set -e
+#DEBHELPER#
+
case "$1" in
configure)
# Remove masks created by dh_systemd_enable on package removal.
deb-systemd-helper unmask pve-firewall.service >/dev/null || true
- systemctl reload-or-restart pve-firewall
+
+ # modeled after dh_systemd_start output
+ systemctl --system daemon-reload >/dev/null || true
+ if [ -n "$2" ]; then
+ _dh_action=try-reload-or-restart
+ else
+ _dh_action=start
+ fi
+ deb-systemd-invoke $_dh_action pve-firewall.service >/dev/null || true
;;
abort-upgrade|abort-remove|abort-deconfigure)
@@ -18,6 +28,4 @@ case "$1" in
;;
esac
-#DEBHELPER#
-
exit 0
--
2.14.2
More information about the pve-devel
mailing list