diff options
author | Holger Levsen <holger@layer-acht.org> | 2017-06-12 18:54:11 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-06-12 18:54:11 +0200 |
commit | 78f11f10a79e418964171a7041f7309b83352032 (patch) | |
tree | 40244f51c6054a19a2622bfb0c2ab21f68e74e3f | |
parent | ac8e4331c6ee2c539d4d147495fc0d77ef04037a (diff) | |
download | jenkins.debian.net-78f11f10a79e418964171a7041f7309b83352032.tar.xz |
reproducible Debian: retry once if systemctl times out
Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-x | bin/reproducible_worker.sh | 9 |
1 files 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) |