diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2016-08-02 09:31:12 +0200 |
---|---|---|
committer | Lukas Nykryn <lnykryn@redhat.com> | 2016-08-02 09:31:12 +0200 |
commit | d39b9feebd08ce67db69b2aab34ea6d0e3c3ec12 (patch) | |
tree | e85b1b51aed66f600b7fb9d932eb9a6728a8cd3f /rc.d/init.d | |
parent | 0e8fdd3b88156289b0020a5bcf85bdb2a8ab9744 (diff) | |
download | initscripts-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/functions | 3 |
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 |