invoke-run: add option to not stop sysv scripts

Closes: #928935
parent 759f6d74
Pipeline #47577 failed with stages
in 8 minutes and 49 seconds
......@@ -40,7 +40,17 @@ if [ -r "/etc/default/${service}" ] ; then
fi
readonly initscript="/etc/init.d/${service}"
readonly noreplace="/var/lib/runit/noreplace/${service}"
if [ -x "${initscript}" ] ; then
# Stopping some services (e.g display manager) is disruptive
# and must be done only manually by user.
if [ -f "${noreplace}" ] ; then
if "${initscript}" status >/dev/null 2>&1 ; then
sv down "${service}"
exit 0
fi
fi
"${initscript}" stop
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment