Fixed RunAfterHook not executed on normal runs
This commit is contained in:
parent
bcbd43fafb
commit
ff6a0b95fc
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
#TODO(critical): handle conflict prevalance, especially in sync_attrs function
|
#TODO(critical): handle conflict prevalance, especially in sync_attrs function
|
||||||
|
#TODO(critical): writelockfiles remote does not shut execution
|
||||||
|
|
||||||
PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
|
PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
|
||||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
||||||
|
@ -98,9 +99,7 @@ function TrapQuit {
|
||||||
exitcode=2 # Warning exit code must not force daemon mode to quit
|
exitcode=2 # Warning exit code must not force daemon mode to quit
|
||||||
else
|
else
|
||||||
UnlockReplicas
|
UnlockReplicas
|
||||||
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
RunAfterHook
|
||||||
RunAfterHook
|
|
||||||
fi
|
|
||||||
CleanUp
|
CleanUp
|
||||||
Logger "$PROGRAM finished." "NOTICE"
|
Logger "$PROGRAM finished." "NOTICE"
|
||||||
exitcode=0
|
exitcode=0
|
||||||
|
@ -1569,10 +1568,10 @@ function Init {
|
||||||
|
|
||||||
# Do not use exit and quit traps if osync runs in monitor mode
|
# Do not use exit and quit traps if osync runs in monitor mode
|
||||||
if [ $sync_on_changes -eq 0 ]; then
|
if [ $sync_on_changes -eq 0 ]; then
|
||||||
trap TrapStop SIGINT SIGHUP SIGTERM SIGQUIT
|
trap TrapStop INT HUP TERM QUIT
|
||||||
trap TrapQuit EXIT
|
trap TrapQuit EXIT
|
||||||
else
|
else
|
||||||
trap TrapQuit SIGTERM EXIT SIGHUP SIGQUIT
|
trap TrapQuit TERM EXIT HUP QUIT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local uri
|
local uri
|
||||||
|
|
Loading…
Reference in New Issue