[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Debian: fixup 8cf7c66f and keep global variables global

Holger Levsen gitlab at salsa.debian.org
Sat Dec 22 13:26:40 GMT 2018


Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
1bdb6b3f by Holger Levsen at 2018-12-22T13:26:31Z
reproducible Debian: fixup 8cf7c66f and keep global variables global

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- bin/reproducible_worker.sh


Changes:

=====================================
bin/reproducible_worker.sh
=====================================
@@ -31,14 +31,6 @@ notify_log_of_failure() {
 }
 
 main_loop() {
-	#
-	# check if we really should be running
-	#
-	RUNNING=$(ps fax|grep -v grep|grep "$0 $1 ")
-	if [ -z "$RUNNING" ] ; then
-		echo "$(date --utc) - '$0 $1' already running, thus stopping this."
-		break
-	fi
 	SERVICE="reproducible_build at startup.service"
 	# try systemctl twice, but only output and thus log the 2nd attempt…
 	RUNNING=$(systemctl show $SERVICE 2>/dev/null |grep ^SubState|cut -d "=" -f2)
@@ -48,14 +40,10 @@ main_loop() {
 		RUNNING=$(systemctl show $SERVICE|grep ^SubState|cut -d "=" -f2)
 		if [ "$RUNNING" != "running" ] ; then
 			echo "$(date --utc) - '$SERVICE' not running, thus stopping this."
-			break
+			sleep 60.1337m
+			exit
 		fi
 	fi
-	LOCKFILE="/var/lib/jenkins/NO-RB-BUILDERS-PLEASE"
-	if [ -f "$LOCKFILE" ]; then
-		echo "The lockfile $LOCKFILE is present, thus stopping this"
-		break
-	fi
 	if [ -f "$JENKINS_OFFLINE_LIST" ]; then
 		for n in "$NODE1" "$NODE2"; do
 			if grep -q "$n" "$JENKINS_OFFLINE_LIST"; then
@@ -104,7 +92,22 @@ main_loop() {
 	[ "$RETCODE" -eq 0 ] || notify_log_of_failure
 }
 
+#
+# check if we really should be running
+#
+RUNNING=$(ps fax|grep -v grep|grep "$0 $1 ")
+if [ -z "$RUNNING" ] ; then
+	echo "$(date --utc) - '$0 $1' already running, thus stopping this."
+	exit
+fi
+LOCKFILE="/var/lib/jenkins/NO-RB-BUILDERS-PLEASE"
+if [ -f "$LOCKFILE" ]; then
+	echo "The lockfile $LOCKFILE is present, thus stopping this"
+	exit
+fi
+#
 # main
+#
 while true ; do
 	main_loop
 done



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/1bdb6b3f64b42f90370768bb1e5f42be33f14705

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/1bdb6b3f64b42f90370768bb1e5f42be33f14705
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20181222/ec06a838/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list