X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Fjenkins-jnlp-connect.sh;h=f7c67694f2d1cd4290db842ecca9cca25843b71f;hb=a7e96beb40b827c9a4369bda79157a3324745bca;hp=c46ca89f512890393edc7e7dbcafb3201285ad76;hpb=ede0336258973c16ec2ba557ec7c8a2bc2cc8168;p=releng.git diff --git a/utils/jenkins-jnlp-connect.sh b/utils/jenkins-jnlp-connect.sh index c46ca89f5..f7c67694f 100755 --- a/utils/jenkins-jnlp-connect.sh +++ b/utils/jenkins-jnlp-connect.sh @@ -52,7 +52,7 @@ main () { fi if [[ $(whoami) != "root" ]]; then - if sudo -l | grep "requiretty"; then + if sudo -l | grep "requiretty" | grep -v "\!requiretty"; then echo "please comment out Defaults requiretty from /etc/sudoers" exit 1 fi @@ -103,7 +103,7 @@ if does not exist then exec "$mkdir -p /var/run/$jenkinsuser" if failed uid $jenkinsuser then exec "$chown $jenkinsuser /var/run/$jenkinsuser" if failed gid $jenkinsuser then exec "$chown :$jenkinsuser /var/run/$jenkinsuser" -check process jenkins with pidfile /var/run/$jenkinsuser/jenkins_jnlp_pid +check process jenkins with pidfile /var/run/$jenkinsuser/jenkins_jnlp_pid every 2 cycles 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)'" depends on jenkins_piddir @@ -118,7 +118,7 @@ if does not exist then exec \"$mkdir -p /var/run/$jenkinsuser\" if failed uid $jenkinsuser then exec \"$chown $jenkinsuser /var/run/$jenkinsuser\" if failed gid $jenkinsuser then exec \"$chown :$jenkinsuser /var/run/$jenkinsuser\" -check process jenkins with pidfile /var/run/$jenkinsuser/jenkins_jnlp_pid +check process jenkins with pidfile /var/run/$jenkinsuser/jenkins_jnlp_pid every 2 cycles 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)'\" depends on jenkins_piddir\