[Piuparts-commits] [piuparts] 01/01: slave_stop: New script to stop all piuparts-slaves on a host.
Holger Levsen
holger at layer-acht.org
Sun Mar 5 23:30:01 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 02982224e54f62808445899e8fcae4ace3a6a042
Author: Holger Levsen <holger at layer-acht.org>
Date: Mon Mar 6 00:27:09 2017 +0100
slave_stop: New script to stop all piuparts-slaves on a host.
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
README_server.txt | 1 +
debian/changelog | 1 +
debian/piuparts-slave.links | 1 +
slave-bin/slave_stop.in | 38 ++++++++++++++++++++++++++++++++++++++
4 files changed, 41 insertions(+)
diff --git a/README_server.txt b/README_server.txt
index 77e0b67..323d1a1 100644
--- a/README_server.txt
+++ b/README_server.txt
@@ -75,6 +75,7 @@ To set this up for yourself, the following steps should suffice:
'/usr/share/doc/piuparts-slave/examples/' to learn which.
. Run '/usr/bin/piuparts_slave_run' and 'piuparts_slave_join' to actually
let the slave(s) run and to join their sessions.
+. Run '/usr/bin/piuparts_slave_stop' to stop all piuparts-slaves on a host.
. The logs go into the master account, into subdirectories.
=== Tuning the setup
diff --git a/debian/changelog b/debian/changelog
index d2124d6..eb75ef0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -48,6 +48,7 @@ piuparts (0.76) UNRELEASED; urgency=medium
started than defined in the configuration. Also add a check to ensure that
this optional argument is an integer and within the defined maximum number
of slaves.
+ * slave_stop: New script to stop all piuparts-slaves on a host.
* Update README_pejacevic.txt and README_server.txt.
* Drop instances/piuparts.conf.lamarr and …/piuparts.conf.goldwasser.
* htdocs/index.tpl:
diff --git a/debian/piuparts-slave.links b/debian/piuparts-slave.links
index 1f5d284..0985baf 100644
--- a/debian/piuparts-slave.links
+++ b/debian/piuparts-slave.links
@@ -1,2 +1,3 @@
/usr/share/piuparts/slave/slave_run /usr/bin/piuparts_slave_run
/usr/share/piuparts/slave/slave_join /usr/bin/piuparts_slave_join
+/usr/share/piuparts/slave/slave_stop /usr/bin/piuparts_slave_stop
diff --git a/slave-bin/slave_stop.in b/slave-bin/slave_stop.in
new file mode 100755
index 0000000..c3f8948
--- /dev/null
+++ b/slave-bin/slave_stop.in
@@ -0,0 +1,38 @@
+#!/bin/sh
+set -e
+
+# Copyright 2017 Holger Levsen (holger at layer-acht.org)
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+#
+# Stop all running piuparts-slaves gracefully and watch…
+#
+
+. @sharedir@/piuparts/lib/read_config.sh
+
+get_config_value SLAVEROOT global slave-directory
+
+
+( sleep 2 && pkill --signal INT --full '/usr/bin/python /srv/piuparts.debian.org/share/piuparts/piuparts-slave' ) &
+cd $SLAVEROOT
+tail -f slave/screenlog.? &
+
+while pgrep --full '/usr/bin/python /srv/piuparts.debian.org/share/piuparts/piuparts-slave' ; do
+ sleep 1
+done
+
+pkill --full 'tail -f slave/screenlog.?'
+
--
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