init.sh: busybox kill compatible signal names

busybox's kill does not accept -s SIGTERM, but only -s TERM
pull/7536/head
Stephan Klatt 2016-10-28 15:30:48 +02:00 committed by GitHub
parent 9a880f6144
commit 35d2fb6e01
1 changed files with 2 additions and 2 deletions

View File

@ -156,7 +156,7 @@ 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
@ -173,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"