[Piuparts-commits] [piuparts] 06/08: stop_slave: run only a single tail process
Holger Levsen
holger at layer-acht.org
Wed May 3 13:40:17 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 6556ef3945cb7d199093936a63483a531a124b16
Author: Andreas Beckmann <anbe at debian.org>
Date: Tue May 2 19:53:04 2017 +0200
stop_slave: run only a single tail process
Signed-off-by: Andreas Beckmann <anbe at debian.org>
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
slave-bin/slave_stop.in | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/slave-bin/slave_stop.in b/slave-bin/slave_stop.in
index 6658a8b..af7f9a0 100755
--- a/slave-bin/slave_stop.in
+++ b/slave-bin/slave_stop.in
@@ -29,15 +29,15 @@ get_config_value SLAVECOUNT global slave-count 1
SESSIONNAME=piuparts_slave_screen
-cleanup_tails() {
- pkill --full 'tail -f screenlog.'
-}
-
cd $SLAVEROOT
-trap cleanup_tails INT TERM EXIT
+LOGS=
for i in $(seq 1 $SLAVECOUNT) ; do
- tail -f screenlog.$i &
+ LOGS="$LOGS screenlog.$i"
done
+tail -f $LOGS &
+TAILPID=$!
+trap "kill $TAILPID" INT TERM EXIT
+
sleep 0.5
pkill --signal INT --full '/usr/bin/python @sharedir@/piuparts/piuparts-slave'
@@ -58,5 +58,5 @@ echo -n "$(date -u +%T) - "
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.'
+kill $TAILPID
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