Last fix for KillChilds pgrep issue on Mac

This commit is contained in:
deajan 2017-05-28 22:20:41 +02:00
parent 1400390f57
commit 11bd517982
1 changed files with 6 additions and 3 deletions

View File

@ -3,7 +3,7 @@
#### OFUNCTIONS MINI SUBSET #### #### OFUNCTIONS MINI SUBSET ####
_OFUNCTIONS_VERSION=2.1.4-dev _OFUNCTIONS_VERSION=2.1.4-dev
_OFUNCTIONS_BUILD=2017052803 _OFUNCTIONS_BUILD=2017052804
#### _OFUNCTIONS_BOOTSTRAP SUBSET #### #### _OFUNCTIONS_BOOTSTRAP SUBSET ####
_OFUNCTIONS_BOOTSTRAP=true _OFUNCTIONS_BOOTSTRAP=true
#### _OFUNCTIONS_BOOTSTRAP SUBSET END #### #### _OFUNCTIONS_BOOTSTRAP SUBSET END ####
@ -334,9 +334,12 @@ function KillChilds {
KillChilds "$child" true KillChilds "$child" true
done done
fi fi
fi
# Try to kill nicely, if not, wait 15 seconds to let Trap actions happen before killing # Try to kill nicely, if not, wait 15 seconds to let Trap actions happen before killing
if [ "$self" == true ]; then if [ "$self" == true ]; then
# We need to check for pid again because it may have disappeared after recursive function call
if kill -0 "$pid" > /dev/null 2>&1; then
kill -s TERM "$pid" kill -s TERM "$pid"
Logger "Sent SIGTERM to process [$pid]." "DEBUG" Logger "Sent SIGTERM to process [$pid]." "DEBUG"
if [ $? != 0 ]; then if [ $? != 0 ]; then