summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debhelper.pod6
-rw-r--r--debian/changelog3
-rwxr-xr-xdh_installinit17
3 files changed, 23 insertions, 3 deletions
diff --git a/debhelper.pod b/debhelper.pod
index 0e6ac9da..d05871c1 100644
--- a/debhelper.pod
+++ b/debhelper.pod
@@ -597,6 +597,12 @@ F<maintscript> config file. This was the original intend but it did
not work properly and packages have begun to rely on the incomplete
shell escaping (e.g. quoting file names).
+=item -
+
+The B<dh_installinit> command now defaults to
+B<--restart-after-upgrade>. For packages needing the previous
+behaviour, please use B<--no-restart-after-upgrade>.
+
=back
=back
diff --git a/debian/changelog b/debian/changelog
index ce4f03e1..ab6a4576 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -34,6 +34,9 @@ debhelper (9.20160116) UNRELEASED; urgency=medium
* dh_compress: Handle file resolution failures more gracefully.
Thanks to Daniel Leidert for reporting this issue.
(Closes: #802274)
+ * dh_installinit: Make --restart-after-upgrade the default in
+ compat 10. Packages can undo this by using the new
+ --no-restart-after-upgrade parameter.
[ Joachim Breitner ]
* addsubstvar: Pass -a to grep to handle substvars with unicode content
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},