From 68e8d386e3408a0055a97a6a14c04ce531810a10 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Tue, 2 Aug 2016 09:31:12 +0200 Subject: functions: systemctl show now returns an error when unit does not exist Cherry-picked from: d39b9feebd08ce67db69b2aab34ea6d0e3c3ec12 Resolves: #1362225 --- rc.d/init.d/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rc.d/init.d/functions') 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 -- cgit v1.2.1