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:40:53 +0200 |
commit | 68e8d386e3408a0055a97a6a14c04ce531810a10 (patch) | |
tree | 72ddda0e062ea2d804b0780cd6c93ef3dce36317 | |
parent | 91ed12dbb433617a83affbbff4acfb0a1045c75a (diff) | |
download | initscripts-68e8d386e3408a0055a97a6a14c04ce531810a10.tar initscripts-68e8d386e3408a0055a97a6a14c04ce531810a10.tar.gz initscripts-68e8d386e3408a0055a97a6a14c04ce531810a10.tar.bz2 initscripts-68e8d386e3408a0055a97a6a14c04ce531810a10.tar.xz initscripts-68e8d386e3408a0055a97a6a14c04ce531810a10.zip |
functions: systemctl show now returns an error when unit does not exist
Cherry-picked from: d39b9feebd08ce67db69b2aab34ea6d0e3c3ec12
Resolves: #1362225
-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 dfbd5e3e..d13ec983 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 |