From d6f77dd26289c8e5770b1832c8830dafed5171e2 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 27 Apr 2017 12:30:23 +0200 Subject: reproducible Debian: only start workers if they are not running already Signed-off-by: Holger Levsen --- bin/reproducible_build_service.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/reproducible_build_service.sh b/bin/reproducible_build_service.sh index 04ee0e33..0c1c3e4c 100755 --- a/bin/reproducible_build_service.sh +++ b/bin/reproducible_build_service.sh @@ -202,11 +202,19 @@ startup_workers() { /bin/sleep $(echo "scale=1 ; $(shuf -i 1-23 -n 1)/10" | bc ) WORKER_NAME=${ARCH}_$i + + WORKER_BIN=/srv/jenkins/bin/reproducible_worker.sh + RUNNING=$(ps fax|grep -v grep|grep "$WORKER_BIN $WORKER_NAME") + if [ -z "$RUNNING" ] ; then + echo "$(date --utc) - '$(basename $WORKER_BIN) $WORKER_NAME' already running, thus moving on to the next." + continue + fi + choose_node $WORKER_NAME BUILD_BASE=/var/lib/jenkins/userContent/reproducible/debian/build_service/$WORKER_NAME mkdir -p $BUILD_BASE echo "$(date --utc) - Starting $WORKER_NAME" - /srv/jenkins/bin/reproducible_worker.sh $WORKER_NAME $NODE1 $NODE2 >$BUILD_BASE/worker.log 2>&1 & + $WORKER_BIN $WORKER_NAME $NODE1 $NODE2 >$BUILD_BASE/worker.log 2>&1 & done done } -- cgit v1.2.3-70-g09d2