summaryrefslogtreecommitdiff
path: root/dh_installinit
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2016-02-27 11:14:13 +0000
committerNiels Thykier <niels@thykier.net>2016-02-27 11:14:13 +0000
commit18187bee56a1da4b76b090811bc7cea0d8c66039 (patch)
treee4f8c4ad65b005cfda975c135b762110e9636c0b /dh_installinit
parent4d71c92575b5b614a030787d8981935bfab44889 (diff)
downloaddebhelper-18187bee56a1da4b76b090811bc7cea0d8c66039.tar.gz
dh_installinit: Make -R the default in compat 10
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'dh_installinit')
-rwxr-xr-xdh_installinit17
1 files changed, 14 insertions, 3 deletions
diff --git a/dh_installinit b/dh_installinit
index b9fc7d6a..981707be 100755
--- a/dh_installinit
+++ b/dh_installinit
@@ -84,14 +84,23 @@ call. Example:
=item B<-R>, B<--restart-after-upgrade>
Do not stop the init script until after the package upgrade has been
-completed. This is different than the default behavior, which stops the
-script in the F<prerm>, and starts it again in the F<postinst>.
+completed. This is the default behaviour in compat 10.
+
+In early compat levels, the default was to stop the script in the
+F<prerm>, and starts it again in the F<postinst>.
This can be useful for daemons that should not have a possibly long
downtime during upgrade. But you should make sure that the daemon will not
get confused by the package being upgraded while it's running before using
this option.
+=item B<--no-restart-after-upgrade>
+
+Undo a previous B<--restart-after-upgrade> (or the default of compat
+10). If no other options are given, this will cause the service to be
+stopped in the F<prerm> script and started again in the F<postinst>
+script.
+
=item B<-r>, B<--no-restart-on-upgrade>
Do not stop init script on upgrade.
@@ -155,11 +164,13 @@ instances of the same text to be added to maintainer scripts.
=cut
+$dh{RESTART_AFTER_UPGRADE} = 1 if not compat(10);
+
init(options => {
"r" => \$dh{R_FLAG},
"no-restart-on-upgrade" => \$dh{R_FLAG},
"no-start" => \$dh{NO_START},
- "R|restart-after-upgrade" => \$dh{RESTART_AFTER_UPGRADE},
+ "R|restart-after-upgrade!" => \$dh{RESTART_AFTER_UPGRADE},
"init-script=s" => \$dh{INIT_SCRIPT},
"update-rcd-params=s", => \$dh{U_PARAMS},
"remove-d" => \$dh{D_FLAG},