[Qa-jenkins-scm] [jenkins.debian.net] 02/02: reproducible Debian: add checks to prevent concurrent runs and from running when service is stopped
Holger Levsen
holger at layer-acht.org
Wed Apr 26 10:48:21 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 6448e85c7d7e36f78443591e76c33bb9446ceb36
Author: Holger Levsen <holger at layer-acht.org>
Date: Wed Apr 26 12:48:03 2017 +0200
reproducible Debian: add checks to prevent concurrent runs and from running when service is stopped
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
bin/reproducible_build_service_worker.sh | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/bin/reproducible_build_service_worker.sh b/bin/reproducible_build_service_worker.sh
index b057b77..9748a6c 100755
--- a/bin/reproducible_build_service_worker.sh
+++ b/bin/reproducible_build_service_worker.sh
@@ -20,8 +20,17 @@ common_init "$@"
. /srv/jenkins/bin/reproducible_common.sh
while true ; do
- # TODO
- # - test here if the builder service is actually 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"
+ RUNNING=$(systemctl show $SERVICE|grep ^SubState|cut -d "=" -f2)
+ if [ "$RUNNING" != "running" ] ; then
+ echo "$(date --utc) - '$SERVICE' not running, thus stopping this."
+ break
+ fi
# sleep up to 2.3 seconds (additionally to the random sleep reproducible_build.sh does anyway)
/bin/sleep $(echo "scale=1 ; $(shuf -i 1-23 -n 1)/10" | bc )
--
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