diff -dupr a/service b/service --- a/service 2017-02-27 06:56:05.000000000 -0800 +++ b/service 2017-04-03 18:36:24.047885982 -0700 @@ -70,7 +70,9 @@ while [ $# -gt 0 ]; do esac done -if [ -f "${SERVICEDIR}/${SERVICE}" ]; then +if `echo $ACTION | egrep -qw "start|stop|restart|try-restart|reload|force-reload|status|condrestart"` ; then + exec /bin/systemctl ${ACTION} ${OPTIONS} ${SERVICE}.service +elif [ -f "${SERVICEDIR}/${SERVICE}" ]; then # LSB daemons that dies abnormally in systemd looks alive in systemd's eyes due to RemainAfterExit=yes # lets reap them before next start if [ "${ACTION}" = "start" ] && \ @@ -81,10 +83,6 @@ if [ -f "${SERVICEDIR}/${SERVICE}" ]; th 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} -elif `echo $ACTION | egrep -qw "start|stop|restart|try-restart|reload|force-reload|status|condrestart"` ; then - SERVICE_MANGLED=$(/usr/bin/systemd-escape --mangle ${SERVICE}) - echo $"Redirecting to /bin/systemctl ${ACTION}${OPTIONS:+ }${OPTIONS} ${SERVICE_MANGLED}" >&2 - 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