From 406692a03dacf3bd74d09c153802a3ea90886b7d Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Thu, 5 Nov 2009 00:33:45 +0100 Subject: [PATCH] buildd lock the buildd push, only one can go out at any time. Signed-off-by: Joerg Jaspert --- config/debian/common | 14 ++++++++++++++ config/debian/cron.buildd | 6 ------ config/debian/cron.unchecked | 4 ++-- config/debian/dinstall.functions | 2 +- config/debian/dinstall.variables | 3 +++ 5 files changed, 20 insertions(+), 9 deletions(-) delete mode 100755 config/debian/cron.buildd diff --git a/config/debian/common b/config/debian/common index 4a0d6cb9..38d95616 100644 --- a/config/debian/common +++ b/config/debian/common @@ -25,6 +25,20 @@ function debug () { 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 diff --git a/config/debian/cron.buildd b/config/debian/cron.buildd deleted file mode 100755 index a5490e51..00000000 --- a/config/debian/cron.buildd +++ /dev/null @@ -1,6 +0,0 @@ -#! /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 diff --git a/config/debian/cron.unchecked b/config/debian/cron.unchecked index 37167128..ee95878f 100755 --- a/config/debian/cron.unchecked +++ b/config/debian/cron.unchecked @@ -33,6 +33,7 @@ LOCKDAILY="" LOCKFILE="$lockdir/unchecked.lock" LOCK_NEW="$lockdir/processnew.lock" NOTICE="$lockdir/daily.lock" +LOCK_BUILDD="$lockdir/buildd.lock" # our name PROGRAM="unchecked" @@ -69,8 +70,7 @@ function do_buildd () { fi done make_buildd_dir - - . $configdir/cron.buildd + wbtrigger "often" fi } diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions index f1e49e42..77ef651d 100644 --- a/config/debian/dinstall.functions +++ b/config/debian/dinstall.functions @@ -418,7 +418,7 @@ function mirror() { 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() { diff --git a/config/debian/dinstall.variables b/config/debian/dinstall.variables index be5b382a..353a3aeb 100644 --- a/config/debian/dinstall.variables +++ b/config/debian/dinstall.variables @@ -38,3 +38,6 @@ LOCK_BRITNEY="$lockdir/britney.lock" # 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" -- 2.39.5