Package: init-system-helpers
Version: 1.51
Severity: wishlist
Tags: patch

this would help integrating "reload-or-restart" functionality into
dh_installsystemd, mimicking the existing semantics of the restart
functionality (no reloading/restarting of disabled/static units which
are not running).

patch attached (since init-systems-helper is not yet on salsa)

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), 
(500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.15.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages init-system-helpers depends on:
ii  perl-base  5.26.1-5

init-system-helpers recommends no packages.

init-system-helpers suggests no packages.

Versions of packages init-system-helpers is related to:
pn  insserv  <none>

-- no debconf information
>From 5e6e377b679602c799c9682cbca8c2d78cadbaba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= <f.gruenbich...@proxmox.com>
Date: Wed, 14 Mar 2018 21:32:33 +0100
Subject: [PATCH] deb-systemd-invoke: support reload-or-restart
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

as a pre-requisite to adding the same support to dh_installsystemd[1],
deb-systemd-invoke should support "reload-or-restart" with the same
semantics as "restart".

1: https://salsa.debian.org/debian/debhelper/merge_requests/1

Signed-off-by: Fabian Grünbichler <f.gruenbich...@proxmox.com>
---
 script/deb-systemd-invoke | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/script/deb-systemd-invoke b/script/deb-systemd-invoke
index 71b1c33..d4362de 100755
--- a/script/deb-systemd-invoke
+++ b/script/deb-systemd-invoke
@@ -35,7 +35,7 @@ deb-systemd-invoke - wrapper around systemctl, respecting policy-rc.d
 
 =head1 SYNOPSIS
 
-B<deb-systemd-invoke> start|stop|restart S<I<unit file> ...>
+B<deb-systemd-invoke> start|stop|restart|reload-or-restart S<I<unit file> ...>
 
 =head1 DESCRIPTION
 
@@ -81,7 +81,7 @@ if (-x $policyhelper) {
 # However, if the job is disabled but has been forced into the running state, we *do* stop
 # and restart it since this is expected behaviour for the admin who forced the start.
 # We don't autostart static units either.
-if ($action eq "start" || $action eq "restart") {
+if ($action eq "start" || $action eq "restart" || $action eq "reload-or-restart") {
     my $global_exit_code = 0;
     my @start_units = ();
     for my $unit (@units) {
@@ -95,7 +95,7 @@ if ($action eq "start" || $action eq "restart") {
         my $unit_active = $?>>8 == 0 ? 1 : 0;
         if (!$unit_installed && $action eq "start") {
             print STDERR "$unit is a disabled or a static unit, not starting it.\n";
-        } elsif (!$unit_installed && !$unit_active && $action eq "restart") {
+        } elsif (!$unit_installed && !$unit_active && ($action eq "restart" || $action eq "reload-or-restart")) {
             print STDERR "$unit is a disabled or a static unit not running, not starting it.\n";
         }
         else {
-- 
2.16.2

Reply via email to