From ee8b213894cb72f27d85afb39f03c6ada74a5a4a Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 28 May 2017 22:20:57 +0200 Subject: [PATCH] Rebuilt targets --- dev/debug_osync.sh | 9 ++++++--- osync.sh | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dev/debug_osync.sh b/dev/debug_osync.sh index 38e808d..87bbeaa 100755 --- a/dev/debug_osync.sh +++ b/dev/debug_osync.sh @@ -41,7 +41,7 @@ IS_STABLE=yes _OFUNCTIONS_VERSION=2.1.4-dev -_OFUNCTIONS_BUILD=2017052803 +_OFUNCTIONS_BUILD=2017052804 _OFUNCTIONS_BOOTSTRAP=true ## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr @@ -364,9 +364,12 @@ function KillChilds { KillChilds "$child" true done fi + fi - # Try to kill nicely, if not, wait 15 seconds to let Trap actions happen before killing - if [ "$self" == true ]; then + # Try to kill nicely, if not, wait 15 seconds to let Trap actions happen before killing + 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" Logger "Sent SIGTERM to process [$pid]." "DEBUG" if [ $? != 0 ]; then diff --git a/osync.sh b/osync.sh index 7cef24d..5603b3e 100755 --- a/osync.sh +++ b/osync.sh @@ -10,7 +10,7 @@ IS_STABLE=yes _OFUNCTIONS_VERSION=2.1.4-dev -_OFUNCTIONS_BUILD=2017052803 +_OFUNCTIONS_BUILD=2017052804 _OFUNCTIONS_BOOTSTRAP=true ## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr @@ -317,9 +317,12 @@ function KillChilds { KillChilds "$child" true done fi + fi - # Try to kill nicely, if not, wait 15 seconds to let Trap actions happen before killing - if [ "$self" == true ]; then + # Try to kill nicely, if not, wait 15 seconds to let Trap actions happen before killing + 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" Logger "Sent SIGTERM to process [$pid]." "DEBUG" if [ $? != 0 ]; then