Fixed bogus debug if in Killchilds
This commit is contained in:
parent
8dbc37eb52
commit
e832cb700b
|
@ -7,7 +7,7 @@ PROGRAM_VERSION=1.1-pre
|
|||
PROGRAM_BUILD=2016040701
|
||||
IS_STABLE=yes
|
||||
|
||||
## FUNC_BUILD=2016040802
|
||||
## FUNC_BUILD=2016041001
|
||||
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||
|
||||
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
||||
|
@ -156,21 +156,20 @@ function KillChilds {
|
|||
|
||||
if children="$(pgrep -P "$pid")"; then
|
||||
for child in $children; do
|
||||
Logger "Launching KillChilds \"$child\" true" "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 [ "$_DEBUG" == "yes" ]; then
|
||||
Logger "Killing process $pid" "NOTICE"
|
||||
kill -s SIGTERM "$pid"
|
||||
if [ $? != 0 ]; then
|
||||
sleep 15 && kill -9 "$pid" &
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
Logger "Killing process $pid" "DEBUG"
|
||||
kill -s SIGTERM "$pid"
|
||||
if [ $? != 0 ]; then
|
||||
sleep 15 && kill -9 "$pid" &
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
# sleep 15 needs to wait before killing itself
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
## FUNC_BUILD=2016040802
|
||||
## FUNC_BUILD=2016041001
|
||||
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||
|
||||
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
||||
|
@ -147,21 +147,20 @@ function KillChilds {
|
|||
|
||||
if children="$(pgrep -P "$pid")"; then
|
||||
for child in $children; do
|
||||
Logger "Launching KillChilds \"$child\" true" "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 [ "$_DEBUG" == "yes" ]; then
|
||||
Logger "Killing process $pid" "NOTICE"
|
||||
kill -s SIGTERM "$pid"
|
||||
if [ $? != 0 ]; then
|
||||
sleep 15 && kill -9 "$pid" &
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
Logger "Killing process $pid" "DEBUG"
|
||||
kill -s SIGTERM "$pid"
|
||||
if [ $? != 0 ]; then
|
||||
sleep 15 && kill -9 "$pid" &
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
# sleep 15 needs to wait before killing itself
|
||||
|
|
19
osync.sh
19
osync.sh
|
@ -7,7 +7,7 @@ PROGRAM_VERSION=1.1-pre
|
|||
PROGRAM_BUILD=2016040701
|
||||
IS_STABLE=yes
|
||||
|
||||
## FUNC_BUILD=2016040802
|
||||
## FUNC_BUILD=2016041001
|
||||
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||
|
||||
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
||||
|
@ -146,21 +146,20 @@ function KillChilds {
|
|||
|
||||
if children="$(pgrep -P "$pid")"; then
|
||||
for child in $children; do
|
||||
Logger "Launching KillChilds \"$child\" true" "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 [ "$_DEBUG" == "yes" ]; then
|
||||
Logger "Killing process $pid" "NOTICE"
|
||||
kill -s SIGTERM "$pid"
|
||||
if [ $? != 0 ]; then
|
||||
sleep 15 && kill -9 "$pid" &
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
Logger "Killing process $pid" "DEBUG"
|
||||
kill -s SIGTERM "$pid"
|
||||
if [ $? != 0 ]; then
|
||||
sleep 15 && kill -9 "$pid" &
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
# sleep 15 needs to wait before killing itself
|
||||
|
|
Loading…
Reference in New Issue