aboutsummaryrefslogtreecommitdiff
path: root/sh/runscript.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh/runscript.sh')
-rwxr-xr-xsh/runscript.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/sh/runscript.sh b/sh/runscript.sh
index 6e711304..e5eb5c22 100755
--- a/sh/runscript.sh
+++ b/sh/runscript.sh
@@ -95,10 +95,16 @@ if [ -n "${command}" ]; then
if ! type start >/dev/null 2>&1; then
start() {
ebegin "Starting ${name:-${SVCNAME}}"
+ case "${command_background}" in
+ [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+ start_stop_daemon_args="${start_stop_daemon_args} --background --pidfile"
+ ;;
+ esac
start-stop-daemon --start \
--exec ${command} \
${procname:+--name} ${procname} \
${pidfile:+--pidfile} ${pidfile} \
+ ${start_stop_daemon_args} \
-- ${command_args}
eend $? "Failed to start ${SVCNAME}"
}