summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2016-11-24 13:32:57 +0000
committerMarkos Chandras <mchandras@suse.de>2016-11-24 14:56:50 +0000
commit90dbe41e705c6247f0171380f49873ac40a54eb1 (patch)
tree30fcdf4a56ce2e5841b1904791d3b5791eaa8373 /utils
parentf2e09a1c47a8333efb7309089017f677db197f6e (diff)
utils: jenkins-jnlp-connect.sh: Fix start up script
The jenkins-jnlp-connect.sh script is meant to be executed from the $jenkinshome directory. The monit script was configured to enter a different directory before starting the jenkins script which always resulted in a broken start-up phase like this: "This script needs to be run from the jenkins users home dir" We fix this by entering the $jenkinshome directory before starting up the jenkins script. Change-Id: If0f65417f07a7fa9328f9adcd1ca1a1a3bc530ed Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/jenkins-jnlp-connect.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/utils/jenkins-jnlp-connect.sh b/utils/jenkins-jnlp-connect.sh
index 9ef4298ef..33463e153 100755
--- a/utils/jenkins-jnlp-connect.sh
+++ b/utils/jenkins-jnlp-connect.sh
@@ -30,8 +30,6 @@ EOF
}
main () {
- dir=$(cd $(dirname $0); pwd)
-
#tests
if [[ -z $jenkinsuser || -z $jenkinshome ]]; then
echo "jenkinsuser or home not defined, please edit this file to define it"
@@ -100,7 +98,7 @@ main () {
echo "Writing the following as monit config:"
cat << EOF | tee $monitconfdir/jenkins
check process jenkins with pidfile /var/run/$jenkinsuser/jenkins_jnlp_pid
-start program = "/usr/bin/sudo -u $jenkinsuser /bin/bash -c 'cd $dir; export started_monit=true; $0 $@' with timeout 60 seconds"
+start program = "/usr/bin/sudo -u $jenkinsuser /bin/bash -c 'cd $jenkinshome; export started_monit=true; $0 $@' with timeout 60 seconds"
stop program = "/bin/bash -c '/bin/kill \$(/bin/cat /var/run/$jenkinsuser/jenkins_jnlp_pid)'"
EOF
}
@@ -109,7 +107,7 @@ EOF
#test for diff
if [[ "$(diff $monitconfdir/jenkins <(echo "\
check process jenkins with pidfile /var/run/$jenkinsuser/jenkins_jnlp_pid
-start program = \"/usr/bin/sudo -u $jenkinsuser /bin/bash -c 'cd $dir; export started_monit=true; $0 $@' with timeout 60 seconds\"
+start program = \"/usr/bin/sudo -u $jenkinsuser /bin/bash -c 'cd $jenkinshome; export started_monit=true; $0 $@' with timeout 60 seconds\"
stop program = \"/bin/bash -c '/bin/kill \$(/bin/cat /var/run/$jenkinsuser/jenkins_jnlp_pid)'\"\
") )" ]]; then
echo "Updating monit config..."