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