aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2015-05-14 11:40:29 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2015-05-14 11:40:29 -0500
commitb79d058f162d8b49ccc968744e7cb1b7a7ba729c (patch)
tree90f9b2e629d76e51d982ee42364d3dc1d50060fe /sh
parentddce529c71c2e9f01d8e5666e27050b6ed6c6761 (diff)
s6: Use s6-svc -Dd to stop services
This allows us to get rid of the sleep call in the stop function. Also, we set a configurable timeout value for stopping daemons.
Diffstat (limited to 'sh')
-rw-r--r--sh/s6.sh6
1 files changed, 1 insertions, 5 deletions
diff --git a/sh/s6.sh b/sh/s6.sh
index a99fd5b8..99aba3fd 100644
--- a/sh/s6.sh
+++ b/sh/s6.sh
@@ -31,11 +31,7 @@ s6_stop()
fi
s6_service_link="${RC_SVCDIR}/s6-scan/${s6_service_path##*/}"
ebegin "Stopping ${name:-$RC_SVCNAME}"
- s6-svc -d "${s6_service_link}"
- if [ -n "$s6_svwait_options_stop" ]; then
- s6-svwait ${s6_svwait_options_stop} "${s6_service_link}"
- fi
- sleep 1.5
+ s6-svc -Dd -T ${s6_service_timeout_stop:-10000} "${s6_service_link}"
set -- $(s6-svstat "${s6_service_link}")
[ "$1" = "down" ]
eend $? "Failed to stop $RC_SVCNAME"