Closed stefanor closed 4 years ago
As I described in #707 , to change java we have to set PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin
or something in /etc/default/jenkins, and currently this cookbook does not support setting PATH in /etc/default/jenkins.
Though default['jenkins']['java']=XXX
writes JAVA=XXX
to /etc/default/jenkins, /etc/init.d/jenkins never look JAVA
environmental variable in the default file.
Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.
Closing due to inactivity. If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.
Cookbook version
5.0.4 (but looks present in 6.0.0 too)
Chef-client version
12.22.1
Platform Details
Ubuntu 18.04
Scenario:
Jenkins doesn't support Java 11 yet, which is the default on Ubuntu 18.04.
The jenkins cookbook appears to provide a mechanism to deal with this, the
jenkins.java
attribute. However, the init script for the jenkins package reads:So, the init script is ignoring the
$JAVA
variable that the cookbook set in/etc/default/jenkins
and instead using the firstjava
on$PATH
.Steps to Reproduce:
Install both a default JRE and a non-default JRE. Set the attribute
force_default['jenkins']['java']
to the non-default JRE.e.g. on Ubuntu 18.04:
and
Install Jenkins using the package method.
Expected Result:
That Jenkins starts using the specified Java version. On Ubuntu 18.04, this would result in a successful start.
Actual Result:
Jenkins attempts to start, using the default JRE, and on Ubuntu 18.04, it fails.