[Qa-jenkins-scm] [jenkins.debian.net] 01/02: reproducible Debian: retry once if systemctl times out

Holger Levsen holger at layer-acht.org
Mon Jun 12 16:59:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 78f11f10a79e418964171a7041f7309b83352032
Author: Holger Levsen <holger at layer-acht.org>
Date:   Mon Jun 12 18:54:11 2017 +0200

    reproducible Debian: retry once if systemctl times out
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_worker.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/bin/reproducible_worker.sh b/bin/reproducible_worker.sh
index f37ca68..c0a9d83 100755
--- a/bin/reproducible_worker.sh
+++ b/bin/reproducible_worker.sh
@@ -32,8 +32,13 @@ while true ; do
 	SERVICE="reproducible_build at startup.service"
 	RUNNING=$(systemctl show $SERVICE|grep ^SubState|cut -d "=" -f2)
 	if [ "$RUNNING" != "running" ] ; then
-		echo "$(date --utc) - '$SERVICE' not running, thus stopping this."
-		break
+		# sometimes systemctl requests time out… handle that gracefully
+		sleep 23
+		RUNNING=$(systemctl show $SERVICE|grep ^SubState|cut -d "=" -f2)
+		if [ "$RUNNING" != "running" ] ; then
+			echo "$(date --utc) - '$SERVICE' not running, thus stopping this."
+			break
+		fi
 	fi
 
 	# sleep up to 2.3 seconds (additionally to the random sleep reproducible_build.sh does anyway)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list