summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Jaspert <joerg@debian.org>2008-10-30 22:47:15 +0100
committerJoerg Jaspert <joerg@debian.org>2008-10-30 22:47:15 +0100
commita1d8f195cf5b8567d6ea2f039dbe49312af2754b (patch)
tree381803e8d1b64aea4074b740bd6c141f3d9d47dc
parent4f0e46fa9307e00c22ee5b5ddc287286834e0056 (diff)
runmirrors
pushlock sync should now work Signed-off-by: Joerg Jaspert <joerg@debian.org>
-rwxr-xr-xbin/runmirrors5
-rw-r--r--etc/common8
2 files changed, 8 insertions, 5 deletions
diff --git a/bin/runmirrors b/bin/runmirrors
index c49162a..c326665 100755
--- a/bin/runmirrors
+++ b/bin/runmirrors
@@ -84,8 +84,12 @@ hook $HOOK
set +e
# Built up our list of 2-stage mirrors.
+PUSHLOCKS=""
PUSHLOCKS=$(get2stage)
+# In case we have it - remove. It is used to synchronize multi-stage mirroring
+rm -f "${LOCKDIR}/all_stage1"
+
# Now read our mirrorfile and push the mirrors defined in there.
# We use grep to easily sort out all lines having a # in front of them or are empty.
egrep -v '^[[:space:]]*(#|$)' "${MIRRORS}" |
@@ -123,7 +127,6 @@ while read MTYPE MLNAME MHOSTNAME MUSER MPROTO MKEYFILE; do
SSHKEY="${MKEYFILE}"
PUSHLOCKOWN="${LOCKDIR}/${MLNAME}.stage1"
PUSHTYPE="${MTYPE}"
- PUSHLOCKS=${PUSHLOCKS}
PUSHARCHIVE=${PUSHARCHIVE}
)
diff --git a/etc/common b/etc/common
index 984d695..532f3ea 100644
--- a/etc/common
+++ b/etc/common
@@ -38,7 +38,6 @@ signal () {
PUSHTYPE=${PUSHTYPE:-"all"}
PUSHARCHIVE=${PUSHARCHIVE:-""}
PUSHCB=${PUSHCB:-""}
- PUSHLOCKS=${PUSHLOCKS:-""}
# Defaults we always want, no matter what
SSH_OPTIONS="-o BatchMode=yes -o SetupTimeOut=45 -o ConnectTimeout=45 -o PasswordAuthentication=no"
@@ -76,7 +75,7 @@ signal () {
# Step2: Wait for all the other "lock"files to appear.
tries=0
# We do not wait forever
- while [ ${tries} -lt 30 ]; do
+ while [ ${tries} -lt 120 ]; do
total=0
found=0
for file in ${PUSHLOCKS}; do
@@ -85,10 +84,11 @@ signal () {
found=$((found + 1))
fi
done
- if [ ${total} -eq ${found} ]; then
+ if [ ${total} -eq ${found} ] || [ -f "${LOCKDIR}/all_stage1" ]; then
+ touch "${LOCKDIR}/all_stage1"
break
fi
- sleep 20
+ sleep 5
done
rm -f "${PUSHLOCKOWN}"