Merge pull request #7536 from ast-systemtechnik/skladd-patch-init.sh

make init.sh compatible with busybox
pull/7679/head
Ross McDonald 2016-12-01 14:08:10 -06:00 committed by GitHub
commit f7c686dbef
1 changed files with 3 additions and 2 deletions

View File

@ -156,7 +156,8 @@ function stop() {
if kill -0 $PID &>/dev/null; then
echo "Stopping $NAME..."
# Process still up, send SIGTERM and remove PIDFILE
kill -s SIGTERM $PID &>/dev/null && rm -f "$PIDFILE" &>/dev/null
kill -s TERM $PID &>/dev/null && rm -f "$PIDFILE" &>/dev/null
n=0
while true; do
# Enter loop to ensure process is stopped
kill -0 $PID &>/dev/null
@ -172,7 +173,7 @@ function stop() {
if [ $n -eq 30 ]; then
# After 30 seconds, send SIGKILL
echo "Timeout exceeded, sending SIGKILL..."
kill -s SIGKILL $PID &>/dev/null
kill -s KILL $PID &>/dev/null
elif [ $? -eq 40 ]; then
# After 40 seconds, error out
log_failure_msg "could not stop $NAME process"