Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46020

/etc/init.d/jenkins overrides JAVA variable set in /etc/defaults/jenkins

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • packaging
    • Ubuntu 16.04.3 LTS, Java 1.8.0_73 in /opt/jdk/production/bin/java
    • 2.335

      After updating the Jenkins installation from version 2.70 to 2.72 the server failed to start. The problem was that the init process detected an old installed open-jdk 1.7 as executing VM instead of using our custom installation in /opt/jdk/production.

      Cause for this problem is a change in file /etc/init.d/jenkins which trys to detect the execting VM with the line:

      JAVA=`type -p java`

      Problem is that we set the Java installation via the /etc/defaults/jenkins file which points to the correct location. The new line overwrites the settings from the defaults file. After commenting the line, everything works as expected.

       

          [JENKINS-46020] /etc/init.d/jenkins overrides JAVA variable set in /etc/defaults/jenkins

          Matt Blair added a comment -

          excentos how exactly did you set the Java installation in /etc/default/jenkins? via the JAVA environment variable?

          Matt Blair added a comment - excentos how exactly did you set the Java installation in /etc/default/jenkins? via the JAVA environment variable?

          Sören Zach added a comment -

          Yes, following lines are in /etc/default/jenkins:

          JAVA=/opt/jdk/production/bin/java
          JAVA_HOME=/opt/jdk/production/

          which is our custom JDK installation.

          Sören Zach added a comment - Yes, following lines are in /etc/default/jenkins: JAVA=/opt/jdk/production/bin/java JAVA_HOME=/opt/jdk/production/ which is our custom JDK installation.

          Basil Crow added a comment -

          As of 2.335 Jenkins has switched to systemd and the mechanism for selecting the Java version has changed. See the documentation for more instructions.

          Basil Crow added a comment - As of 2.335 Jenkins has switched to systemd and the mechanism for selecting the Java version has changed. See the documentation for more instructions.

            basil Basil Crow
            excentos Sören Zach
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: