summaryrefslogtreecommitdiff
path: root/autoscripts
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2015-11-06 23:13:34 +0100
committerNiels Thykier <niels@thykier.net>2015-11-06 23:14:09 +0100
commit0f09b1f88b36eeb99d0b7df8ae2702442e03b45f (patch)
tree666eb8398560d5884b9b6e057bf4b59eb9108808 /autoscripts
parentcafe7c0ec8983bf8eb6b792ab3f90102f66de20f (diff)
downloaddebhelper-0f09b1f88b36eeb99d0b7df8ae2702442e03b45f.tar.gz
dh_installinit: Disable init scripts on removal
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'autoscripts')
-rw-r--r--autoscripts/postrm-init11
1 files changed, 9 insertions, 2 deletions
diff --git a/autoscripts/postrm-init b/autoscripts/postrm-init
index 6f5bb09a..9881b1cf 100644
--- a/autoscripts/postrm-init
+++ b/autoscripts/postrm-init
@@ -1,10 +1,17 @@
+if [ "$1" = "remove" ] ; then
+ # Attempt to disable but ignore failures as it is not
+ # required (and the script must be a able to handle
+ # being called while the package is removed, but not
+ # yet purged)
+ update-rc.d #SCRIPT# disable >/dev/null || true
+fi
if [ "$1" = "purge" ] ; then
update-rc.d #SCRIPT# remove >/dev/null
fi
-# In case this system is running systemd, we make systemd reload the unit files
-# to pick up changes.
+# In case this system is running systemd, we make systemd reload the
+# unit files to pick up changes.
if [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi