File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -388,16 +388,17 @@ function KillChilds {
388388 kill -s TERM " $pid "
389389 Logger " Sent SIGTERM to process [$pid ]." " DEBUG"
390390 if [ $? -ne 0 ]; then
391- sleep 15
392- Logger " Sending SIGTERM to process [$pid ] failed." " DEBUG"
393- kill -9 " $pid "
394- if [ $? -ne 0 ]; then
395- Logger " Sending SIGKILL to process [$pid ] failed." " DEBUG"
396- return 1
397- fi # Simplify the return 0 logic here
398- else
399- return 0
400- fi
391+ sleep 60 # Arbitrary wait time to let process terminate gracefully
392+ if kill -0 " $pid " > /dev/null 2>&1 ; then
393+ Logger " Sending SIGTERM to process [$pid ] failed." " DEBUG"
394+ kill -9 " $pid "
395+ if [ $? -ne 0 ]; then
396+ Logger " Sending SIGKILL to process [$pid ] failed." " DEBUG"
397+ return 1
398+ fi # Simplify the return 0 logic here
399+ else
400+ return 0
401+ fi
401402 else
402403 return 0
403404 fi
You can’t perform that action at this time.
0 commit comments