diff options
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/jenkins-jnlp-connect.sh | 12 | ||||
-rwxr-xr-x[-rw-r--r--] | utils/retention_script.sh | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/utils/jenkins-jnlp-connect.sh b/utils/jenkins-jnlp-connect.sh index 8c41620d6..d268a28de 100755 --- a/utils/jenkins-jnlp-connect.sh +++ b/utils/jenkins-jnlp-connect.sh @@ -48,6 +48,14 @@ main () { exit 1 fi + if [[ $(whoami) != "root" ]]; then + if grep "^Defaults requiretty" /etc/sudoers + then echo "please comment out Defaults requiretty from /etc/sudoers" + exit 1 + fi + fi + + if [ -d /etc/monit/conf.d ]; then monitconfdir="/etc/monit/conf.d/" elif [ -d /etc/monit.d ]; then @@ -87,7 +95,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 $@'" +start program = "/usr/bin/sudo -u $jenkinsuser /bin/bash -c 'cd $dir; 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 } @@ -96,7 +104,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 $@'\" +start program = \"/usr/bin/sudo -u $jenkinsuser /bin/bash -c 'cd $dir; 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..." diff --git a/utils/retention_script.sh b/utils/retention_script.sh index 9a8986ca5..7e50623ca 100644..100755 --- a/utils/retention_script.sh +++ b/utils/retention_script.sh @@ -15,6 +15,8 @@ # limitations under the License. ############################################################################## +PATH=$PATH:/usr/local/bin/ + #These are the only projects that generate artifacts for x in armband ovsnfv fuel apex compass4nfv do @@ -28,9 +30,9 @@ do daysold=$(($age/86400)) if [[ "$daysold" -gt "10" ]]; then - echo "$daysold Days old Deleting: $(basename $artifact)" + echo "$daysold Days old deleting: $(basename $artifact)" else - echo "$daysold Days old Retaining: $(basename $artifact)" + echo "$daysold Days old retaining: $(basename $artifact)" fi done < <(gsutil ls gs://artifacts.opnfv.org/"$x" |grep -v "/$") |