Unverified Commit 388d7f6e authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

reproducible debian: build service: exit often if the lockfile is present



previously it would exit only at the start of the worker, which is not
that frequent

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent ee2749b6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -31,6 +31,11 @@ notify_log_of_failure() {
}

main_loop() {
	LOCKFILE="/var/lib/jenkins/NO-RB-BUILDERS-PLEASE"
	if [ -f "$LOCKFILE" ]; then
		echo "The lockfile $LOCKFILE is present, thus stopping this"
		exit
	fi
	SERVICE="reproducible_build@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)
@@ -100,11 +105,6 @@ 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
#