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

Hi,
systemctl status should be invoked with --no-pager, otherwise it might
hang on non-interactive command. This was observed running serverspec's

   describe service('systemd-timesyncd') do
     it { should be_running }
   end

Possible patch attached.
Cheers,
 -- Guido


-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'stable-updates'), (500, 'oldoldstable'), (500, 
'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.14.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE.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-3

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

-- no debconf information
>From 5d027fd1b9bedc9ca7bac243ca61f31c4092e6f4 Mon Sep 17 00:00:00 2001
Message-Id: <5d027fd1b9bedc9ca7bac243ca61f31c4092e6f4.1516194782.git....@sigxcpu.org>
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <a...@sigxcpu.org>
Date: Wed, 17 Jan 2018 14:11:27 +0100
Subject: [PATCH] service: pass --no-pager to "systemctl status"

Otherwise it might hang e.g. when run over ssh from serverspec
---
 script/service | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/script/service b/script/service
index 3872a59..7a41670 100755
--- a/script/service
+++ b/script/service
@@ -171,9 +171,12 @@ then
    fi
 
    case "${ACTION}" in
-      restart|status|try-restart)
+      restart|try-restart)
          exec systemctl $sctl_args ${ACTION} ${UNIT}
       ;;
+      status)
+         exec systemctl --no-pager $sctl_args ${ACTION} ${UNIT}
+      ;;
       start|stop)
          # Follow the principle of least surprise for SysV people:
          # When running "service foo stop" and foo happens to be a service that
-- 
2.15.1

_______________________________________________
Pkg-systemd-maintainers mailing list
Pkg-systemd-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-systemd-maintainers

Reply via email to