aboutsummaryrefslogtreecommitdiffstats
path: root/service
diff options
context:
space:
mode:
authorVáclav Pavlín <vpavlin@redhat.com>2013-08-07 14:54:46 +0200
committerLukas Nykryn <lnykryn@redhat.com>2013-08-19 14:11:12 +0200
commit513ed0501d8665e04fd1950fb6f95f152df9b4e4 (patch)
tree1a073a1bb666c8eba02a78df0f6d71210d1e04ba /service
parent4e2971ae366d192a892db979fcac02106b4579ff (diff)
downloadinitscripts-513ed0501d8665e04fd1950fb6f95f152df9b4e4.tar
initscripts-513ed0501d8665e04fd1950fb6f95f152df9b4e4.tar.gz
initscripts-513ed0501d8665e04fd1950fb6f95f152df9b4e4.tar.bz2
initscripts-513ed0501d8665e04fd1950fb6f95f152df9b4e4.tar.xz
initscripts-513ed0501d8665e04fd1950fb6f95f152df9b4e4.zip
service: filter actions that are not supported by systemctl in service (#947823)
Diffstat (limited to 'service')
-rwxr-xr-xservice4
1 files changed, 3 insertions, 1 deletions
diff --git a/service b/service
index 9c2fd4af..66870060 100755
--- a/service
+++ b/service
@@ -74,7 +74,9 @@ if [ -f "${SERVICEDIR}/${SERVICE}" ]; then
env -i PATH="$PATH" TERM="$TERM" SYSTEMCTL_IGNORE_DEPENDENCIES=${SYSTEMCTL_IGNORE_DEPENDENCIES} SYSTEMCTL_SKIP_REDIRECT=${SYSTEMCTL_SKIP_REDIRECT} "${SERVICEDIR}/${SERVICE}" ${ACTION} ${OPTIONS}
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}
-else
+elif `echo $ACTION | egrep -q "start|stop|restart|try-restart|reload|force-reload|status"` ; then
echo $"Redirecting to /bin/systemctl ${ACTION} ${OPTIONS} ${SERVICE}.service" >&2
exec /bin/systemctl ${ACTION} ${OPTIONS} ${SERVICE}.service
+else
+ exit 2
fi