From d39b9feebd08ce67db69b2aab34ea6d0e3c3ec12 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 --- rc.d/init.d/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1