Bug#896944: service: this wrapper script should pass additional options to systemctl(8) when using systemd

WHR msl0000023508 at gmail.com
Thu Apr 26 09:26:03 BST 2018


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

The service(8) script should pass additional options, if any after '${ACTION}', to systemctl(8).

For example, if I run 'service rsyslog status', I would got:

# service rsyslog status 
● rsyslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-04-26 07:49:06 UTC; 22min ago
     Docs: man:rsyslogd(8)
           http://www.rsyslog.com/doc/
 Main PID: 12149 (rsyslogd)
    Tasks: 5 (limit: 4915)
   CGroup: /system.slice/rsyslog.service
           └─12149 /usr/sbin/rsyslogd -n

Apr 26 07:49:06 x systemd[1]: Starting System Logging Service...
Apr 26 07:49:06 x liblogging-stdlog[12149]:  [origin software="rsyslog…rt
Apr 26 07:49:06 x systemd[1]: Started System Logging Service.
Hint: Some lines were ellipsized, use -l to show in full.


The systemctl(8) has hinted an option '-l' to show those long lines; but when
I trying 'service rsyslog status -l', the output shows no different.


I wrote a small patch to support those options.

--- service.orig	2018-04-26 08:15:54.462271387 +0000
+++ service	2018-04-26 08:23:08.782884186 +0000
@@ -193,6 +193,14 @@
        sctl_args="--job-mode=ignore-dependencies"
    fi
 
+   for o in ${OPTIONS}; do
+       case "$o" in
+          -*)
+             sctl_args="$sctl_args $o"
+             ;;
+       esac
+   done
+
    case "${ACTION}" in
       restart|status|try-restart)
          exec systemctl $sctl_args ${ACTION} ${UNIT}



-- System Information:
Debian Release: 9.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=UTF-8), LANGUAGE=zh_CN.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages init-system-helpers depends on:
ii  perl-base  5.24.1-3+deb9u3

init-system-helpers recommends no packages.

init-system-helpers suggests no packages.

Versions of packages init-system-helpers is related to:
ii  insserv  1.14.0-5.4+b1

-- debconf-show failed


More information about the Pkg-systemd-maintainers mailing list