[Piuparts-commits] [piuparts] 02/16: stop_slave: don't hardcode paths

Holger Levsen holger at layer-acht.org
Thu Apr 13 15:04:51 UTC 2017


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

holger pushed a commit to branch develop
in repository piuparts.

commit 17b7c975306908cc4c910a6c6237e91ee6b544e8
Author: Andreas Beckmann <anbe at debian.org>
Date:   Mon Apr 10 20:47:11 2017 +0200

    stop_slave: don't hardcode paths
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 slave-bin/slave_stop.in | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/slave-bin/slave_stop.in b/slave-bin/slave_stop.in
index 8459c62..6658a8b 100755
--- a/slave-bin/slave_stop.in
+++ b/slave-bin/slave_stop.in
@@ -27,6 +27,8 @@ get_config_value SLAVEROOT global slave-directory
 get_config_value SLAVECOUNT global slave-count 1
 
 
+SESSIONNAME=piuparts_slave_screen
+
 cleanup_tails() {
 	pkill --full 'tail -f screenlog.'
 }
@@ -37,12 +39,12 @@ for i in $(seq 1 $SLAVECOUNT) ; do
 	tail -f screenlog.$i &
 done
 sleep 0.5
-pkill --signal INT --full '/usr/bin/python /srv/piuparts.debian.org/share/piuparts/piuparts-slave'
+pkill --signal INT --full '/usr/bin/python @sharedir@/piuparts/piuparts-slave'
 
 i=1
-while pgrep --full '/usr/bin/python /srv/piuparts.debian.org/share/piuparts/piuparts-slave' > /dev/null ; do
+while pgrep --full '/usr/bin/python @sharedir@/piuparts/piuparts-slave' > /dev/null ; do
 	echo -n "$(date -u +%T) - "
-	pgrep --full '/usr/bin/python /srv/piuparts.debian.org/share/piuparts/piuparts-slave' | xargs -r echo -n "slaves running: "
+	pgrep --full '/usr/bin/python @sharedir@/piuparts/piuparts-slave' | xargs -r echo -n "slaves running: "
 	SLEEP=$(( $i * $i ))
 	echo -n " sleeping ${SLEEP}sec now..."
 	for j in $(seq 1 $SLEEP) ; do
@@ -53,8 +55,8 @@ while pgrep --full '/usr/bin/python /srv/piuparts.debian.org/share/piuparts/piup
 	i=$(( $i + 1 ))
 done
 echo -n "$(date -u +%T) - "
-pgrep --full '/usr/bin/python /srv/piuparts.debian.org/share/piuparts/piuparts-slave' | xargs echo "slaves running: (should list none) "
+pgrep --full '/usr/bin/python @sharedir@/piuparts/piuparts-slave' | xargs echo "slaves running: (should list none) "
 
 trap - INT TERM EXIT
 pkill --full 'tail -f screenlog.'
-pkill --full 'SCREEN -S piuparts_slave_screen -d -m'
+pkill --full "SCREEN -S $SESSIONNAME -d -m"

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



More information about the Piuparts-commits mailing list