Improved forced quit
This commit is contained in:
parent
0db693bbe6
commit
706e6a531b
|
@ -15,6 +15,8 @@ KNOWN ISSUES
|
|||
RECENT CHANGES
|
||||
--------------
|
||||
|
||||
- Improved forced quit command by killing all child processes
|
||||
- Before / after commands are now ignored on dryruns
|
||||
- Improved verbose output
|
||||
- Fixed various typos
|
||||
- Enforced CheckConnectivityRemoteHost and CheckConnectivity3rdPartyHosts checks (if one of these fails, osync is stopped)
|
||||
|
|
14
osync.sh
14
osync.sh
|
@ -77,6 +77,9 @@ function TrapStop
|
|||
|
||||
function TrapQuit
|
||||
{
|
||||
## Stopping all running child processes
|
||||
pkill -TERM -P $$
|
||||
|
||||
if [ $error_alert -ne 0 ]
|
||||
then
|
||||
SendAlert
|
||||
|
@ -310,7 +313,11 @@ function WaitForCompletion
|
|||
## Runs local command $1 and waits for completition in $2 seconds
|
||||
function RunLocalCommand
|
||||
{
|
||||
CheckConnectivity3rdPartyHosts
|
||||
if [ $dryrun -ne 0 ]
|
||||
then
|
||||
Log "Dryrun: Local command [$1] not run."
|
||||
return 1
|
||||
fi
|
||||
$1 > /dev/shm/osync_run_local_$SCRIPT_PID 2>&1 &
|
||||
child_pid=$!
|
||||
WaitForTaskCompletion $child_pid 0 $2
|
||||
|
@ -333,6 +340,11 @@ function RunRemoteCommand
|
|||
{
|
||||
CheckConnectivity3rdPartyHosts
|
||||
CheckConnectivityRemoteHost
|
||||
if [ $dryrun -ne 0 ]
|
||||
then
|
||||
Log "Dryrun: Local command [$1] not run."
|
||||
return 1
|
||||
fi
|
||||
eval "$SSH_CMD \"$1\" > /dev/shm/osync_run_remote_$SCRIPT_PID 2>&1 &"
|
||||
child_pid=$!
|
||||
WaitForTaskCompletion $child_pid 0 $2
|
||||
|
|
Loading…
Reference in New Issue