diff options
author | Jan Macku <jamacku@redhat.com> | 2020-11-11 11:24:57 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-11-11 14:08:35 +0100 |
commit | 0231415885598ae62ec8ec53dc73aeb53e6ac05b (patch) | |
tree | 19d71f0230ef8ddf8364fcb991a783612de9250c | |
parent | a12a581be738371b6e5dc3b924fd762537908ba7 (diff) | |
download | initscripts-0231415885598ae62ec8ec53dc73aeb53e6ac05b.tar initscripts-0231415885598ae62ec8ec53dc73aeb53e6ac05b.tar.gz initscripts-0231415885598ae62ec8ec53dc73aeb53e6ac05b.tar.bz2 initscripts-0231415885598ae62ec8ec53dc73aeb53e6ac05b.tar.xz initscripts-0231415885598ae62ec8ec53dc73aeb53e6ac05b.zip |
service: catch unsupported action keywords
Resolves: #1894492
-rwxr-xr-x | usr/sbin/service | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/sbin/service b/usr/sbin/service index 36d7083d..4e82bad1 100755 --- a/usr/sbin/service +++ b/usr/sbin/service @@ -90,11 +90,11 @@ 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 [ -n "${ACTION}" ] && [ -x "${ACTIONDIR}/${SERVICE}/${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 [[ $ACTION =~ start|stop|restart|try-restart|reload|force-reload|status|condrestart ]]; then +elif [[ $ACTION =~ ^(start|stop|restart|try-restart|reload|reload-or-restart|try-reload-or-restart|force-reload|status|condrestart)$ ]]; then SERVICE_MANGLED=$(/usr/bin/systemd-escape --mangle "${SERVICE}") echo $"Redirecting to /bin/systemctl ${ACTION} ${SERVICE_MANGLED}${OPTIONS:+ }${OPTIONS}" >&2 exec /bin/systemctl "${ACTION}" "${SERVICE_MANGLED}" ${OPTIONS} 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 + echo $"The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, reload-or-restart, try-reload-or-restart, force-reload, status, condrestart). For other actions, please try to use systemctl." >&2 exit 2 fi |