From: Josep Puigdemont Date: Thu, 10 Mar 2016 15:39:48 +0000 (+0100) Subject: jenkins-jnlp-connect.sh: monit config file was always updated X-Git-Tag: colorado.1.0~608^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=359784285460e067d0aad154b366187665a1f2e7;p=releng.git jenkins-jnlp-connect.sh: monit config file was always updated The jenkins-jnlp-connect.sh script will check whether a monit configuration file for jenkins exists. If it does, it will make sure the contents are correct according to the paramters provided in the command line. The check is made diffing the contents of the file with what is expected by the script. However the script compares the contents of the file against a string that is not exactly the same to what would be written to the file by the script, resulting in the check always failing, and the file being rewritten unnecessarily every time. Change-Id: I0b15195e9d667c11898942c92b39ef3fb053821d Signed-off-by: Josep Puigdemont --- diff --git a/utils/jenkins-jnlp-connect.sh b/utils/jenkins-jnlp-connect.sh index ec31a4aa7..10ac50b0a 100755 --- a/utils/jenkins-jnlp-connect.sh +++ b/utils/jenkins-jnlp-connect.sh @@ -100,8 +100,8 @@ if [[ -f $monitconfdir/jenkins ]]; then #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 $@'\" -stop program = \" /bin/bash -c '/bin/kill \$(/bin/cat /var/run/$jenkinsuser/jenkins_jnlp_pid)'\"\ +start program = \"/usr/bin/sudo -u $jenkinsuser /bin/bash -c 'cd $dir; export started_monit=true; $0 $@'\" +stop program = \"/bin/bash -c '/bin/kill \$(/bin/cat /var/run/$jenkinsuser/jenkins_jnlp_pid)'\"\ ") )" ]]; then echo "Updating monit config..." makemonit $@