From da8e65c5335e21ba449d03def580bac1355cb0df Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 8 May 2008 00:05:30 -0400 Subject: 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 --- autoscripts/postinst-init-restart | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 autoscripts/postinst-init-restart (limited to 'autoscripts/postinst-init-restart') diff --git a/autoscripts/postinst-init-restart b/autoscripts/postinst-init-restart new file mode 100644 index 00000000..ba4b3a02 --- /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 -- cgit v1.2.3