[Git][qa/jenkins.debian.net][master] anchor the pgre matching to avoid confusing 1 and 10

Mattia Rizzolo (@mattia) gitlab at salsa.debian.org
Sat Mar 9 21:05:50 GMT 2024



Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net


Commits:
1b6d987f by Mattia Rizzolo at 2024-03-09T22:04:59+01:00
anchor the pgre matching to avoid confusing 1 and 10

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


2 changed files:

- bin/reproducible_build_service.sh
- bin/reproducible_worker.sh


Changes:

=====================================
bin/reproducible_build_service.sh
=====================================
@@ -39,6 +39,7 @@ startup_workers() {
 
 			# shellcheck disable=SC2143
 			if [ -z "$(grep "$WORKER_NAME " /srv/jenkins/bin/reproducible_build_workers|grep -v '^#')" ]; then
+				echo "$(date --utc) - $WORKER_NAME not configure, not starting at this time"
 				continue
 			fi
 
@@ -61,7 +62,7 @@ startup_workers() {
 
 			# systemd can be in weird state, so just look at what real
 			# processes are around, don't look at what systemd think it's running
-			if pgrep -f "$WORKER_BIN $WORKER_NAME" 2> /dev/null ; then
+			if pgrep -f "$WORKER_BIN $WORKER_NAME\$" > /dev/null ; then
 				echo "$(date --utc) - '$(basename $WORKER_BIN) $WORKER_NAME' already running, thus moving on to the next."
 				continue
 			fi


=====================================
bin/reproducible_worker.sh
=====================================
@@ -135,10 +135,10 @@ main_loop() {
 #
 # check if we really should be running
 #
-PGREP_OUT=$(pgrep -f "reproducible_worker.sh $1"|grep -v $PPID||true)
+PGREP_OUT=$(pgrep -f "reproducible_worker.sh $1\$"|grep -v $PPID||true)
 if [ -n "$PGREP_OUT" ]; then
 	echo "$(date --utc) - 'reproducible_worker.sh $1' already running (I'm $$, father is $PPID):"
-	pgrep -f -a "reproducible_worker.sh $1"
+	pgrep -f -a "reproducible_worker.sh $1\$"
 	echo "$(date --utc) - stopping the current process."
 	exit 10
 fi



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/1b6d987f6d475e86d2a8042dc7bc53ac0ed98a4b

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/1b6d987f6d475e86d2a8042dc7bc53ac0ed98a4b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20240309/0339e5e3/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list