[debhelper-devel] [debhelper] 01/01: dh_installinit: Conditionally run the postint snippets
Niels Thykier
nthykier at moszumanska.debian.org
Fri Nov 6 21:12:24 UTC 2015
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository debhelper.
commit e4f4c774143b5b89dbaae49eab05f2f52e661903
Author: Niels Thykier <niels at thykier.net>
Date: Thu Aug 13 09:52:02 2015 +0200
dh_installinit: Conditionally run the postint snippets
Signed-off-by: Niels Thykier <niels at thykier.net>
---
autoscripts/postinst-init | 8 +++++---
autoscripts/postinst-init-nostart | 6 ++++--
autoscripts/postinst-init-restart | 16 +++++++++-------
autoscripts/postinst-init-tmpfiles | 10 ++++++----
debian/changelog | 3 +++
5 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/autoscripts/postinst-init b/autoscripts/postinst-init
index 2430b2c..9652c77 100644
--- a/autoscripts/postinst-init
+++ b/autoscripts/postinst-init
@@ -1,4 +1,6 @@
-if [ -x "/etc/init.d/#SCRIPT#" ]; then
- update-rc.d #SCRIPT# #INITPARMS# >/dev/null
- invoke-rc.d #SCRIPT# start || #ERROR_HANDLER#
+if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
+ if [ -x "/etc/init.d/#SCRIPT#" ]; then
+ update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+ invoke-rc.d #SCRIPT# start || #ERROR_HANDLER#
+ fi
fi
diff --git a/autoscripts/postinst-init-nostart b/autoscripts/postinst-init-nostart
index 7a1bd5e..687a4f6 100644
--- a/autoscripts/postinst-init-nostart
+++ b/autoscripts/postinst-init-nostart
@@ -1,3 +1,5 @@
-if [ -x "/etc/init.d/#SCRIPT#" ]; then
- update-rc.d #SCRIPT# #INITPARMS# >/dev/null || #ERROR_HANDLER#
+if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
+ if [ -x "/etc/init.d/#SCRIPT#" ]; then
+ update-rc.d #SCRIPT# #INITPARMS# >/dev/null || #ERROR_HANDLER#
+ fi
fi
diff --git a/autoscripts/postinst-init-restart b/autoscripts/postinst-init-restart
index 35bba20..3fffa30 100644
--- a/autoscripts/postinst-init-restart
+++ b/autoscripts/postinst-init-restart
@@ -1,9 +1,11 @@
-if [ -x "/etc/init.d/#SCRIPT#" ]; then
- update-rc.d #SCRIPT# #INITPARMS# >/dev/null
- if [ -n "$2" ]; then
- _dh_action=restart
- else
- _dh_action=start
+if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
+ if [ -x "/etc/init.d/#SCRIPT#" ]; then
+ update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+ if [ -n "$2" ]; then
+ _dh_action=restart
+ else
+ _dh_action=start
+ fi
+ invoke-rc.d #SCRIPT# $_dh_action || #ERROR_HANDLER#
fi
- invoke-rc.d #SCRIPT# $_dh_action || #ERROR_HANDLER#
fi
diff --git a/autoscripts/postinst-init-tmpfiles b/autoscripts/postinst-init-tmpfiles
index fd613bc..9bce94c 100644
--- a/autoscripts/postinst-init-tmpfiles
+++ b/autoscripts/postinst-init-tmpfiles
@@ -1,5 +1,7 @@
-# In case this system is running systemd, we need to ensure that all
-# necessary tmpfiles (if any) are created before starting.
-if [ -d /run/systemd/system ] ; then
- systemd-tmpfiles --create #TMPFILES# >/dev/null || true
+if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
+ # In case this system is running systemd, we need to ensure that all
+ # necessary tmpfiles (if any) are created before starting.
+ if [ -d /run/systemd/system ] ; then
+ systemd-tmpfiles --create #TMPFILES# >/dev/null || true
+ fi
fi
diff --git a/debian/changelog b/debian/changelog
index 9b0da4b..e2f6dae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,9 @@ debhelper (9.20151005) unstable; urgency=medium
patches from Niko Tyni to make timestamp of directories
created from "find"-pipelines reproducible.
(Closes: #802005)
+ * dh_installinit: The postinst snippets are now only run
+ during "configure" or "abort-upgrade".
+ (Closes: #188028)
[ Translations ]
* Update German translation (Chris Leick)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git
More information about the debhelper-devel
mailing list