summaryrefslogtreecommitdiff
path: root/autoscripts
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-05-08 00:05:30 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-05-08 00:05:30 -0400
commitda8e65c5335e21ba449d03def580bac1355cb0df (patch)
treed423990b8caea86f99e8044a50667d391d4b2cd2 /autoscripts
parent0dbdf93cb69c3336da3ffac4db50092ca982ff07 (diff)
dh_installinit: Add --restart-after-upgrade, which avoids stopping a daemon in the prerm, and instead restarts it in the postinst, keeping its downtime minimal. Since some daemons could break if files are upgraded while they're running, it's not the default. It might become the default in a future (v8) compatability level. Closes: #471060
Diffstat (limited to 'autoscripts')
-rw-r--r--autoscripts/postinst-init-restart13
1 files changed, 13 insertions, 0 deletions
diff --git a/autoscripts/postinst-init-restart b/autoscripts/postinst-init-restart
new file mode 100644
index 0000000..ba4b3a0
--- /dev/null
+++ b/autoscripts/postinst-init-restart
@@ -0,0 +1,13 @@
+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
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ invoke-rc.d #SCRIPT# $_dh_action || #ERROR_HANDLER#
+ else
+ /etc/init.d/#SCRIPT# $_dh_action || #ERROR_HANDLER#
+ fi
+fi