aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2016-05-27 14:27:55 +0200
committerLukas Nykryn <lnykryn@redhat.com>2016-05-27 14:28:12 +0200
commit1c17940c3425e698b59a6d8a2ceaa5212a9c0530 (patch)
tree045e3c961172b521b412789a81eb0f499e23da9e
parent3a01f26785ca58a4c50648dbaccaf5ddbd61e028 (diff)
downloadinitscripts-1c17940c3425e698b59a6d8a2ceaa5212a9c0530.tar
initscripts-1c17940c3425e698b59a6d8a2ceaa5212a9c0530.tar.gz
initscripts-1c17940c3425e698b59a6d8a2ceaa5212a9c0530.tar.bz2
initscripts-1c17940c3425e698b59a6d8a2ceaa5212a9c0530.tar.xz
initscripts-1c17940c3425e698b59a6d8a2ceaa5212a9c0530.zip
service: use systemd mangle for given service
-rwxr-xr-xservice3
1 files changed, 2 insertions, 1 deletions
diff --git a/service b/service
index 79792fc5..8a41f14e 100755
--- a/service
+++ b/service
@@ -83,7 +83,8 @@ elif [ -x "${ACTIONDIR}/${SERVICE}/${ACTION}" -a -n "${ACTION}" ]; then
env -i PATH="$PATH" TERM="$TERM" SYSTEMCTL_IGNORE_DEPENDENCIES=${SYSTEMCTL_IGNORE_DEPENDENCIES} SYSTEMCTL_SKIP_REDIRECT=${SYSTEMCTL_SKIP_REDIRECT} "${ACTIONDIR}/${SERVICE}/${ACTION}" ${OPTIONS}
elif `echo $ACTION | egrep -qw "start|stop|restart|try-restart|reload|force-reload|status|condrestart"` ; then
echo $"Redirecting to /bin/systemctl ${ACTION} ${OPTIONS} ${SERVICE}.service" >&2
- exec /bin/systemctl ${ACTION} ${OPTIONS} ${SERVICE}.service
+ SERVICE_MANGLED=$(/usr/bin/systemd-escape --mangle ${SERVICE})
+ exec /bin/systemctl ${ACTION} ${OPTIONS} ${SERVICE_MANGLED}
else
echo $"The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl." >&2
exit 2