aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2016-08-02 09:31:12 +0200
committerLukas Nykryn <lnykryn@redhat.com>2016-08-02 09:31:12 +0200
commitd39b9feebd08ce67db69b2aab34ea6d0e3c3ec12 (patch)
treee85b1b51aed66f600b7fb9d932eb9a6728a8cd3f /rc.d/init.d
parent0e8fdd3b88156289b0020a5bcf85bdb2a8ab9744 (diff)
downloadinitscripts-d39b9feebd08ce67db69b2aab34ea6d0e3c3ec12.tar
initscripts-d39b9feebd08ce67db69b2aab34ea6d0e3c3ec12.tar.gz
initscripts-d39b9feebd08ce67db69b2aab34ea6d0e3c3ec12.tar.bz2
initscripts-d39b9feebd08ce67db69b2aab34ea6d0e3c3ec12.tar.xz
initscripts-d39b9feebd08ce67db69b2aab34ea6d0e3c3ec12.zip
functions: systemctl show now returns an error when unit does not exist
Diffstat (limited to 'rc.d/init.d')
-rw-r--r--rc.d/init.d/functions3
1 files changed, 2 insertions, 1 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index d3159163..0f1d0420 100644
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -47,7 +47,8 @@ systemctl_redirect () {
options="--ignore-dependencies"
fi
- if systemctl show -p LoadState "$prog.service" | grep -q 'not-found' ; then
+ if ! systemctl show "$prog.service" > /dev/null 2>&1 || \
+ systemctl show -p LoadState "$prog.service" | grep -q 'not-found' ; then
action $"Reloading systemd: " /bin/systemctl daemon-reload
fi