[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] sync file from the newest jenkins 2.107.3 package

Mattia Rizzolo gitlab at salsa.debian.org
Wed May 9 13:24:45 BST 2018


Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net


Commits:
db5ca26e by Mattia Rizzolo at 2018-05-09T14:24:20+02:00
sync file from the newest jenkins 2.107.3 package

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


1 changed file:

- hosts/jenkins/etc/init.d/jenkins


Changes:

=====================================
hosts/jenkins/etc/init.d/jenkins
=====================================
--- a/hosts/jenkins/etc/init.d/jenkins
+++ b/hosts/jenkins/etc/init.d/jenkins
@@ -24,10 +24,16 @@ SCRIPTNAME=/etc/init.d/$NAME
 #DAEMON=$JENKINS_SH
 DAEMON=/usr/bin/daemon
 DAEMON_ARGS="--name=$NAME --inherit --env=JENKINS_HOME=$JENKINS_HOME --output=$JENKINS_LOG --pidfile=$PIDFILE"
+JAVA=`type -p java`
+
+JAVA_ALLOWED_VERSION="18"
 
 if [ -n "$UMASK" ]; then
     DAEMON_ARGS="$DAEMON_ARGS --umask=$UMASK"
 fi
+if [ "$JENKINS_ENABLE_ACCESS_LOG" = "yes" ]; then
+    DAEMON_ARGS="$DAEMON_ARGS --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/$NAME/access_log"
+fi
 
 SU=/bin/su
 
@@ -43,6 +49,26 @@ if [ "$RUN_STANDALONE" = "false" ]; then
     exit 1
 fi
 
+# Make sure there exists a java executable, it may not be allways the case
+if [ -z "$JAVA" ]; then
+    echo "ERROR: No Java executable found in current PATH: $PATH" >&2
+    echo "If you actually have java installed on the system make sure the executable is in the aforementioned path and that 'type -p java' returns the java executable path" >&2
+    exit 1
+fi
+
+# Work out the JAVA version we are working with:
+JAVA_VERSION=$($JAVA -version 2>&1 | sed -n ';s/.* version "\(.*\)\.\(.*\)\..*"/\1\2/p;')
+
+if [ "$JAVA_VERSION" = "$JAVA_ALLOWED_VERSION" ]; then
+    echo "Correct java version found" >&2
+else
+    echo "Found an incorrect Java version" >&2
+    echo "Java version found:" >&2
+    echo $($JAVA -version) >&2
+    echo "Aborting" >&2
+    exit 1
+fi
+
 # load environments
 if [ -r /etc/default/locale ]; then
   . /etc/default/locale



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/db5ca26e3d01dddf8186a2920c2f91337fbd2906

---
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/db5ca26e3d01dddf8186a2920c2f91337fbd2906
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20180509/9457b172/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list