Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 828650 - dev-util/jenkins-bin: jenkins.service unit using system java
Summary: dev-util/jenkins-bin: jenkins.service unit using system java
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Patrick Lauer
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-12-09 23:48 UTC by Samuel Bernardo
Modified: 2022-02-14 01:28 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Bernardo 2021-12-09 23:48:27 UTC
As a suggestion, would be better to avoid defining in jenkins.service the ExecStart with /usr/bin/java, but instead use only java, so it can be override by PATH definition to use another java version if required. I just define a drop-in like the following, but doesn't work because is not possible to override ExecStart:

[Service]
Environment=JAVA_HOME=/usr/lib64/openjdk-11
Environment=JDK_HOME=/usr/lib64/openjdk-11
Environment=PATH=${JAVA_HOME}/bin/:${PATH}
ExecStart=java ${JENKINS_JAVA_OPTIONS} ...
Comment 1 Samuel Bernardo 2022-01-19 18:18:01 UTC
Jenkins service only starts when systemd service type is "simple".
Comment 2 Samuel Bernardo 2022-01-26 00:10:23 UTC
I saw this approach to define jenkins.service where is possible to define the required environment variables to set the preferred java version to use with jenkins:

https://aur.archlinux.org/cgit/aur.git/tree/jenkins.conf?h=jenkins-lts
https://aur.archlinux.org/cgit/aur.git/tree/jenkins.service?h=jenkins-lts
Comment 3 Samuel Bernardo 2022-02-14 00:50:02 UTC
Created the following PR:
https://github.com/gentoo/gentoo/pull/24186