From d698fd4cebcaebfc0de5b829524a86634cf44d69 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 31 May 2016 16:58:39 +0200 Subject: [PATCH] Use systemctl's new --value switch to get the CanReload and LoadState property directly. --- debian/extra/init-functions.d/40-systemd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/extra/init-functions.d/40-systemd b/debian/extra/init-functions.d/40-systemd index f80d5bc5c..fb5463bc4 100644 --- a/debian/extra/init-functions.d/40-systemd +++ b/debian/extra/init-functions.d/40-systemd @@ -10,8 +10,8 @@ if [ -d /run/systemd/system ]; then # Don't try to run masked services. Don't check for errors, if # this errors, we'll just call systemctl and possibly explode # there. - state=$(systemctl -p LoadState show $service 2>/dev/null) - [ "$state" = "LoadState=masked" ] && exit 0 + state=$(systemctl -p LoadState --value show $service 2>/dev/null) + [ "$state" = "masked" ] && exit 0 # Redirect SysV init scripts when executed by the user if [ $PPID -ne 1 ] && [ -z "${init:-}" ] && [ -z "${_SYSTEMCTL_SKIP_REDIRECT:-}" ]; then @@ -20,7 +20,7 @@ if [ -d /run/systemd/system ]; then _use_systemctl=1 # Some services can't reload through the .service file, # but can through the init script. - if [ "$(systemctl -p CanReload show $service 2>/dev/null)" = "CanReload=no" ] && [ "${1:-}" = "reload" ]; then + if [ "$(systemctl -p CanReload --value show $service 2>/dev/null)" = "no" ] && [ "${1:-}" = "reload" ]; then _use_systemctl=0 fi ;;