b/postrm: let debhelper generate systemd stuff

With #DEBHELPER# the manual maintained code will be autogenerated, no
need to manually track which services and timers this packages has.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2018-03-12 14:14:06 +01:00 committed by Fabian Grünbichler
parent 3877d4bff5
commit 3fde056435
2 changed files with 2 additions and 34 deletions

34
debian/postrm vendored
View File

@ -19,36 +19,4 @@ case "$1" in
;;
esac
# same as dh_systemd_enable (code copied)
systemctl --system daemon-reload >/dev/null || true
PVESERVICES="pvedaemon pveproxy spiceproxy pvestatd pvebanner pvenetcommit pve-guests"
PVETIMERS="pvesr"
if [ "$1" = "remove" ]; then
for timer in ${PVETIMERS}; do
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper mask $timer.timer >/dev/null
fi
done
for service in ${PVESERVICES}; do
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper mask $service.service >/dev/null
fi
done
fi
if [ "$1" = purge ]; then
for timer in ${PVETIMERS}; do
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge $timer.timer >/dev/null
deb-systemd-helper unmask $timer.timer >/dev/null
fi
done
for service in ${PVESERVICES}; do
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge $service.service >/dev/null
deb-systemd-helper unmask $service.service >/dev/null
fi
done
fi
#DEBHELPER#

2
debian/rules vendored
View File

@ -10,4 +10,4 @@ override_dh_fixperms:
dh_fixperms -Xpvemailforward -Xvar/log/pveproxy
%:
dh $@
dh $@ --with=systemd