summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_cleanup_nodes.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2017-06-03 16:11:36 +0200
committerHolger Levsen <holger@layer-acht.org>2017-06-03 16:11:36 +0200
commit9417a77511dd9592815d6009abec9c0efaca9319 (patch)
treef914ac87a5b395bf758b7cd934f175471b4d48b7 /bin/reproducible_cleanup_nodes.sh
parente064e1007b3a8fb4af6e992cd33270038fd4f288 (diff)
downloadjenkins.debian.net-9417a77511dd9592815d6009abec9c0efaca9319.tar.xz
reproducible Debian: adapt for new build service
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_cleanup_nodes.sh')
-rwxr-xr-xbin/reproducible_cleanup_nodes.sh29
1 files changed, 10 insertions, 19 deletions
diff --git a/bin/reproducible_cleanup_nodes.sh b/bin/reproducible_cleanup_nodes.sh
index 9656a651..9d64c8fa 100755
--- a/bin/reproducible_cleanup_nodes.sh
+++ b/bin/reproducible_cleanup_nodes.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright © 2015-2016 Holger Levsen <holger@layer-acht.org>
+# Copyright © 2015-2017 Holger Levsen <holger@layer-acht.org>
# released under the GPLv=2
DEBUG=false
@@ -19,15 +19,14 @@ elif [ "$(whoami)" != "jenkins" ] ; then
exit 1
fi
-# deny running this if jenkins is still running
-if [ "$1" != "--force" ] ; then
- RESULT=$(ps fax|grep '/usr/share/jenkins/jenkins.war'|grep -v grep||true)
- if [ -n "$RESULT" ] ; then
- echo "jenkins is still running, aborting."
- exit 1
- else
- echo "jenkins is not running, ok, let's go."
- fi
+# deny running this if build service is still running
+SERVICE="reproducible_build@startup.service"
+RESULT=$(systemctl show $SERVICE|grep ^ActiveState=active||true)
+if [ -n "$RESULT" ] ; then
+ echo "$SERVICE is still running, aborting."
+ exit 1
+else
+ echo "$SERVICE is not running, ok, let's go."
fi
# simple confirmation needed
@@ -46,13 +45,5 @@ for NODE in $BUILD_NODES ; do
/srv/jenkins/bin/jenkins_master_wrapper.sh /srv/jenkins/bin/reproducible_slay.sh &
done
-sleep 15
-echo "killing all ssh and sleep processes now. (press enter || ctrl-c)"
-read
-set +e
-killall ssh
-killall sleep
-killall -9 ssh
-killall -9 sleep
-echo "$(date -u) - slaughtering done. Happy rebooting or whatever you plan to do."
+echo "$(date -u) - slaughtering done."