diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2013-09-15 04:34:17 +0000 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2013-09-15 04:34:17 +0000 |
commit | 34f1de71a363168bb62161f9796eb727df8ab797 (patch) | |
tree | b209e30a2a94fbaf34f521c2a5ed0da8b539e94a | |
parent | c419de25e649229caa9fec50deaf73c29fe55f4a (diff) | |
download | init-system-helpers-34f1de71a363168bb62161f9796eb727df8ab797.tar.gz |
update maintscripts to mask a service while removed (but not purged)
fixes #722521, #714903
-rw-r--r-- | autoscripts/postinst-systemd-dont-enable | 3 | ||||
-rw-r--r-- | autoscripts/postinst-systemd-enable | 3 | ||||
-rw-r--r-- | autoscripts/postrm-systemd | 15 |
3 files changed, 14 insertions, 7 deletions
diff --git a/autoscripts/postinst-systemd-dont-enable b/autoscripts/postinst-systemd-dont-enable index efc179f..2dd86a1 100644 --- a/autoscripts/postinst-systemd-dont-enable +++ b/autoscripts/postinst-systemd-dont-enable @@ -1,4 +1,7 @@ if deb-systemd-helper debian-installed #UNITFILE#; then + # This will only remove masks created by d-s-h on package removal. + deb-systemd-helper unmask #UNITFILE# >/dev/null || true + if deb-systemd-helper --quiet was-enabled #UNITFILE#; then # Create new symlinks, if any. deb-systemd-helper enable #UNITFILE# >/dev/null || true diff --git a/autoscripts/postinst-systemd-enable b/autoscripts/postinst-systemd-enable index b8f630a..b903038 100644 --- a/autoscripts/postinst-systemd-enable +++ b/autoscripts/postinst-systemd-enable @@ -1,3 +1,6 @@ +# This will only remove masks created by d-s-h on package removal. +deb-systemd-helper unmask #UNITFILE# >/dev/null || true + # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled #UNITFILE#; then # Enables the unit on first installation, creates new diff --git a/autoscripts/postrm-systemd b/autoscripts/postrm-systemd index 4e7c74d..c8a5a32 100644 --- a/autoscripts/postrm-systemd +++ b/autoscripts/postrm-systemd @@ -1,11 +1,12 @@ -if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then +if [ "$1" = "remove" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then - if [ "$1" = "purge" ]; then - export _DEB_SYSTEMD_HELPER_PURGE=1 - else - # To explicitly clean the environment. - export _DEB_SYSTEMD_HELPER_PURGE=0 - fi + deb-systemd-helper mask #UNITFILES# >/dev/null + fi +fi + +if [ "$1" = "purge" ]; then + if [ -x "/usr/bin/deb-systemd-helper" ]; then + export _DEB_SYSTEMD_HELPER_PURGE=1 deb-systemd-helper disable #UNITFILES# >/dev/null fi fi |