diff options
author | Joerg Jaspert <joerg@debian.org> | 2010-01-01 21:05:43 +0100 |
---|---|---|
committer | Joerg Jaspert <joerg@debian.org> | 2010-01-01 21:05:43 +0100 |
commit | 0e0304ab618fefcac1983ab865816cd8985d9ac2 (patch) | |
tree | d14974c62c1712b95d5680151ba67765c68a6e32 | |
parent | c74f60450c015fab1b8136097b71d3c0a4fb23a4 (diff) |
If we are run from within ftpsync *and* have an mhop push to send on, we have
to wait until the push is gone through and they all returned, or we will exit
much too early.
Signed-off-by: Joerg Jaspert <joerg@debian.org>
-rwxr-xr-x | bin/runmirrors | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/runmirrors b/bin/runmirrors index 752e351..c43cf90 100755 --- a/bin/runmirrors +++ b/bin/runmirrors @@ -255,6 +255,24 @@ while read MTYPE MLNAME MHOSTNAME MUSER MSSHOPT; do set +e done +# If we are run from within ftpsync *and* have an mhop push to send on, we have +# to wait until the push is gone through and they all returned, or we will exit +# much too early. +# As the signal routine touches $LOCKDIR/all_stage1 when all are done, its +# easy enough just to wait for that to appear. Of course we do the same game +# with PUSHDELAY to not wait forever. +if [ "xtruex" = "x${FROMFTPSYNC}x" ] && [ "xmhopx" = "x${PUSHKIND}x" ]; then + tries=0 + # We do not wait forever + while [ ${tries} -lt ${PUSHDELAY} ]; do + if [ -f "${LOCKDIR}/all_stage1" ]; then + break + fi + tries=$((tries + 5)) + sleep 5 + done +fi + HOOK=( HOOKNR=3 HOOKSCR=${HOOK3} |