[debhelper-devel] [debhelper] 01/01: dh_installinit: Conditionally run the postint snippets

Niels Thykier nthykier at moszumanska.debian.org
Thu Aug 13 07:52:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch bug-188028
in repository debhelper.

commit bff98799a05c8a0aeadc70db874535bafeca1836
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 cdfa82b..998ab7e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ debhelper (9.20150811+unreleased) UNRELEASED; urgency=medium
   * cmake.pm: Add better cross-compile support for cmake.
     Heavily based on a patch from Helmut Grohne.
     (Closes: #794396)
+  * dh_installinit: The postinst snippets are now only run
+    during "configure" or "abort-upgrade".
+    (Closes: #188028)
 
  -- Niels Thykier <niels at thykier.net>  Wed, 12 Aug 2015 10:46:59 +0200
 

-- 
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