Merge pull request #7536 from ast-systemtechnik/skladd-patch-init.sh
make init.sh compatible with busyboxpull/7679/head
commit
f7c686dbef
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue