Our default start command should correctly recover on failed re-entrant services
This commit is contained in:
parent
09f949de5e
commit
07e3d69c52
@ -109,20 +109,29 @@ unset _f
|
|||||||
if [ -n "${command}" ]; then
|
if [ -n "${command}" ]; then
|
||||||
if ! type start >/dev/null 2>&1; then
|
if ! type start >/dev/null 2>&1; then
|
||||||
start() {
|
start() {
|
||||||
|
local _background=
|
||||||
ebegin "Starting ${name:-${SVCNAME}}"
|
ebegin "Starting ${name:-${SVCNAME}}"
|
||||||
case "${command_background}" in
|
if yesno "${command_background}"; then
|
||||||
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
|
_background="--background --pidfile"
|
||||||
start_stop_daemon_args="${start_stop_daemon_args} --background --pidfile"
|
fi
|
||||||
;;
|
if yesno "${start_inactive}"; then
|
||||||
esac
|
local _inactive=false
|
||||||
yesno "${start_inactive}" && mark_service_inactive "${SVCNAME}"
|
service_inactive "${SVCNAME}" && _inactive=true
|
||||||
|
mark_service_inactive "${SVCNAME}"
|
||||||
|
fi
|
||||||
start-stop-daemon --start \
|
start-stop-daemon --start \
|
||||||
--exec ${command} \
|
--exec ${command} \
|
||||||
${procname:+--name} ${procname} \
|
${procname:+--name} ${procname} \
|
||||||
${pidfile:+--pidfile} ${pidfile} \
|
${pidfile:+--pidfile} ${pidfile} \
|
||||||
${start_stop_daemon_args} \
|
${_background} ${start_stop_daemon_args} \
|
||||||
-- ${command_args}
|
-- ${command_args}
|
||||||
eend $? "Failed to start ${SVCNAME}"
|
eend $? "Failed to start ${SVCNAME}" && return 0
|
||||||
|
if yesno "${start_inactive}"; then
|
||||||
|
if ! ${_inactive}; then
|
||||||
|
mark_service_stopped "${SVCNAME}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user