File 0009-Use-systemctl-quiet-is-active-instead-status.patch of Package sysconfig.2730

From cc460e8571c1cac6af6bdfbf815f649163aa047e Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.com>
Date: Thu, 23 Jan 2014 10:32:05 +0100
Subject: [PATCH] Use systemctl --quiet is-active instead status
Upstream: yes
References: bnc#859360

A systemctl status is quite expensive as it (by default) parses
logs, etc. Use is-active where we need the code only (bnc#859360).
---
 scripts/netconfig.d/ntp-runtime | 2 +-
 scripts/poll.tcpip              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/netconfig.d/ntp-runtime b/scripts/netconfig.d/ntp-runtime
index 22a34d8..2ce253a 100755
--- a/scripts/netconfig.d/ntp-runtime
+++ b/scripts/netconfig.d/ntp-runtime
@@ -228,7 +228,7 @@ do_runtime_update()
 
     local status
     if [ "$(cat /proc/1/comm)" = "systemd" ]; then
-        systemctl status ntp >/dev/null 2>&1
+        systemctl --quiet is-active ntp >/dev/null 2>&1
     elif [ -x $r/etc/init.d/ntp ]; then
         $r/etc/init.d/ntp status >/dev/null 2>&1
     fi
diff --git a/scripts/poll.tcpip b/scripts/poll.tcpip
index 2ce411e..f5ca379 100755
--- a/scripts/poll.tcpip
+++ b/scripts/poll.tcpip
@@ -44,7 +44,7 @@ sleep 5
 # and no running ntp.
 #
 if type -p systemctl &> /dev/null ; then
-    systemctl status ntp.service &> /dev/null
+    systemctl --quiet is-active ntp.service &> /dev/null
 else
     /usr/sbin/rcntp status &> /dev/null
 fi
-- 
1.8.4

openSUSE Build Service is sponsored by