From 1400390f57a1655e960b18caef0853819b8e278c Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 28 May 2017 21:25:22 +0200 Subject: [PATCH] Rebuilt targets --- dev/debug_osync.sh | 28 ++++++++++++++-------------- osync.sh | 26 +++++++++++++------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/dev/debug_osync.sh b/dev/debug_osync.sh index c39d76e..38e808d 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=2017052802 +_OFUNCTIONS_BUILD=2017052803 _OFUNCTIONS_BOOTSTRAP=true ## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr @@ -352,21 +352,21 @@ function KillChilds { return 1 fi - # Warning: pgrep does not exist in cygwin, have this checked in CheckEnvironment - if children="$(pgrep -P "$pid")"; then - if [[ "$pid" == *"$children"* ]]; then - Logger "Bogus pgrep implementation." "CRITICAL" - children="${children/$pid/}" + if kill -0 "$pid" > /dev/null 2>&1; then + # Warning: pgrep does not exist in cygwin, have this checked in CheckEnvironment + if children="$(pgrep -P "$pid")"; then + if [[ "$pid" == *"$children"* ]]; then + Logger "Bogus pgrep implementation." "CRITICAL" + children="${children/$pid/}" + fi + for child in $children; do + Logger "Launching KillChilds \"$child\" true" "DEBUG" #__WITH_PARANOIA_DEBUG + KillChilds "$child" true + done fi - for child in $children; do - Logger "Launching KillChilds \"$child\" true" "DEBUG" #__WITH_PARANOIA_DEBUG - KillChilds "$child" true - done - fi - # Try to kill nicely, if not, wait 15 seconds to let Trap actions happen before killing - if [ "$self" == true ]; then - if kill -0 "$pid" > /dev/null 2>&1; then + # Try to kill nicely, if not, wait 15 seconds to let Trap actions happen before killing + if [ "$self" == true ]; then kill -s TERM "$pid" Logger "Sent SIGTERM to process [$pid]." "DEBUG" if [ $? != 0 ]; then diff --git a/osync.sh b/osync.sh index 38564eb..7cef24d 100755 --- a/osync.sh +++ b/osync.sh @@ -10,7 +10,7 @@ IS_STABLE=yes _OFUNCTIONS_VERSION=2.1.4-dev -_OFUNCTIONS_BUILD=2017052802 +_OFUNCTIONS_BUILD=2017052803 _OFUNCTIONS_BOOTSTRAP=true ## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr @@ -306,20 +306,20 @@ function KillChilds { return 1 fi - # Warning: pgrep does not exist in cygwin, have this checked in CheckEnvironment - if children="$(pgrep -P "$pid")"; then - if [[ "$pid" == *"$children"* ]]; then - Logger "Bogus pgrep implementation." "CRITICAL" - children="${children/$pid/}" + if kill -0 "$pid" > /dev/null 2>&1; then + # Warning: pgrep does not exist in cygwin, have this checked in CheckEnvironment + if children="$(pgrep -P "$pid")"; then + if [[ "$pid" == *"$children"* ]]; then + Logger "Bogus pgrep implementation." "CRITICAL" + children="${children/$pid/}" + fi + for child in $children; do + KillChilds "$child" true + done fi - for child in $children; do - KillChilds "$child" true - done - fi - # Try to kill nicely, if not, wait 15 seconds to let Trap actions happen before killing - if [ "$self" == true ]; then - if kill -0 "$pid" > /dev/null 2>&1; then + # Try to kill nicely, if not, wait 15 seconds to let Trap actions happen before killing + if [ "$self" == true ]; then kill -s TERM "$pid" Logger "Sent SIGTERM to process [$pid]." "DEBUG" if [ $? != 0 ]; then