lock the buildd push, only one can go out at any time.
Signed-off-by: Joerg Jaspert <joerg@debian.org>
fi
}
+function wbtrigger() {
+ MODE=${1:-"often"}
+ SSHOPT="-o BatchMode=yes -o ConnectTimeout=30 -o SetupTimeout=240"
+ if lockfile -r 3 -l 3600 "${LOCK_BUILDD}"; then
+ if [ "x${MODE}x" = "xdailyx" ]; then
+ ssh -o ${SSHOPT} wbadm@buildd /org/wanna-build/trigger.daily || echo "W-B trigger.daily failed" | mail -s "W-B Daily trigger failed" ftpmaster@ftp-master.debian.org
+ elif [ "x${MODE}x" = "xoftenx" ]; then
+ ssh -q -q ${SSHOPT} wbadm@buildd /org/wanna-build/trigger.often
+ else
+ log_error "Unknown wb trigger mode called"
+ fi
+ fi
+}
+
# used by cron.dinstall *and* cron.unchecked.
function make_buildd_dir () {
dak manage-build-queues -v buildd
+++ /dev/null
-#! /bin/sh
-#
-# Called from cron.unchecked to update wanna-build, each time it runs.
-#
-ssh -q -q -o BatchMode=yes -o ConnectTimeout=30 -o SetupTimeout=240 wbadm@buildd /org/wanna-build/trigger.often
-exit 0
LOCKFILE="$lockdir/unchecked.lock"
LOCK_NEW="$lockdir/processnew.lock"
NOTICE="$lockdir/daily.lock"
+LOCK_BUILDD="$lockdir/buildd.lock"
# our name
PROGRAM="unchecked"
fi
done
make_buildd_dir
-
- . $configdir/cron.buildd
+ wbtrigger "often"
fi
}
function wb() {
log "Trigger daily wanna-build run"
- ssh -o BatchMode=yes -o SetupTimeOut=90 -o ConnectTimeout=90 wbadm@buildd /org/wanna-build/trigger.daily || echo "W-B trigger.daily failed" | mail -s "W-B Daily trigger failed" ftpmaster@ftp-master.debian.org
+ wbtrigger "daily"
}
function expire() {
# If this file exists we exit immediately after the currently running
# function is done
LOCK_STOP="$lockdir/archive.stop"
+
+# Lock buildd updates
+LOCK_BUILDD="$lockdir/buildd.lock"