[debhelper-devel] [debhelper] 01/02: systemd_start: do not start when --no-start and --restart-after-upgrade are combined
Niels Thykier
nthykier at moszumanska.debian.org
Thu Dec 15 07:21:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository debhelper.
commit 43c01e83a51bcfc31480f0ba955dcb25c4181eae
Author: Felipe Sateler <fsateler at debian.org>
Date: Sat Oct 22 20:49:12 2016 -0300
systemd_start: do not start when --no-start and --restart-after-upgrade are combined
But do restart on upgrades
Signed-off-by: Niels Thykier <niels at thykier.net>
---
autoscripts/postinst-systemd-restartnostart | 6 ++++++
dh_systemd_start | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/autoscripts/postinst-systemd-restartnostart b/autoscripts/postinst-systemd-restartnostart
new file mode 100644
index 0000000..eb52e27
--- /dev/null
+++ b/autoscripts/postinst-systemd-restartnostart
@@ -0,0 +1,6 @@
+if [ -d /run/systemd/system ]; then
+ systemctl --system daemon-reload >/dev/null || true
+ if [ -n "$2" ]; then
+ deb-systemd-invoke try-restart #UNITFILES# >/dev/null || true
+ fi
+fi
diff --git a/dh_systemd_start b/dh_systemd_start
index 940fc80..46c14a7 100755
--- a/dh_systemd_start
+++ b/dh_systemd_start
@@ -225,7 +225,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
};
if ($dh{RESTART_AFTER_UPGRADE}) {
- $sd_autoscript->("postinst", "postinst-systemd-restart");
+ my $snippet = "postinst-systemd-restart" . ($dh{NO_START} ? "nostart" : "");
+ $sd_autoscript->("postinst", $snippet);
} elsif (!$dh{NO_START}) {
# We need to stop/start before/after the upgrade.
$sd_autoscript->("postinst", "postinst-systemd-start");
--
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