[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: fix perms to clean up nodes
Holger Levsen
holger at moszumanska.debian.org
Wed Jan 6 14:29:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit 46fcc07a51eec653c8befc10471346897e1e8e54
Author: Holger Levsen <holger at layer-acht.org>
Date: Wed Jan 6 15:28:54 2016 +0100
reproducible: fix perms to clean up nodes
---
bin/jenkins_node_wrapper.sh | 2 +-
bin/reproducible_cleanup_nodes.sh | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/bin/jenkins_node_wrapper.sh b/bin/jenkins_node_wrapper.sh
index ebf61ef..5820d93 100755
--- a/bin/jenkins_node_wrapper.sh
+++ b/bin/jenkins_node_wrapper.sh
@@ -60,7 +60,7 @@ allowed_cmds=()
if [[ "$*" =~ /bin/true ]] ; then
exec /bin/true ; croak "Exec failed";
-elif [[ "$*" = "/srv/jenkins/bin/reproducible_slay.sh" ]] ; then
+elif [[ "$*" = "cleanup_nodes /srv/jenkins/bin/reproducible_slay.sh" ]] ; then
exec /srv/jenkins/bin/reproducible_slay.sh ; croak "Exec failed";
elif [[ "$*" =~ /bin/nc\ localhost\ 4949 ]] ; then
exec /bin/nc localhost 4949 ; croak "Exec failed";
diff --git a/bin/reproducible_cleanup_nodes.sh b/bin/reproducible_cleanup_nodes.sh
index 49094ac..c6dd7d2 100755
--- a/bin/reproducible_cleanup_nodes.sh
+++ b/bin/reproducible_cleanup_nodes.sh
@@ -10,10 +10,13 @@ common_init "$@"
# common code defining db access
. /srv/jenkins/bin/reproducible_common.sh
-# only run this on the main node
+# only run this on the main node as jenkins
if [ "$HOSTNAME" != "jenkins" ] ; then
echo "this script must only be run on the main node, aborting."
exit 1
+elif [ "$(whoami)" != "jenkins" ] ; then
+ echo "this script must only be run as jenkins user, aborting."
+ exit 1
fi
# deny running this if jenkins is still running
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list