From 78f11f10a79e418964171a7041f7309b83352032 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 12 Jun 2017 18:54:11 +0200 Subject: reproducible Debian: retry once if systemctl times out Signed-off-by: Holger Levsen --- 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 f37ca689..c0a9d83e 100755 --- a/bin/reproducible_worker.sh +++ b/bin/reproducible_worker.sh @@ -32,8 +32,13 @@ while true ; do SERVICE="reproducible_build@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) -- cgit v1.2.3-70-g09d2