Thanks, Mark,

your suggestion works perfectly. For the record, I now have a 
file /etc/systemd/system/jenkins.service.d/override.conf with the following 
content:

    [Service]
    Environment="JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-amd64"
    Environment="JENKINS_PORT=8008"

This changes both the JVM, that is used to run Jenkins, and the port number.

Jochen
 

On Tuesday, January 2, 2024 at 8:30:08 PM UTC+1 Mark Waite wrote:

> On Tuesday, January 2, 2024 at 12:22:51 PM UTC-7 Jochen wrote:
>
>
> Hi,
>
> I am using the Jenkins Debian packages from
>
>     https://pkg.origin.jenkins.io/debian/
>
> to install, and update Jenkins. In general, I'm quite happy with that. 
> There is one exception, though:
>
> My setup requires changing of two environment variables, JENKINS_PORT, and 
> JAVA_HOME. Right now, I have configured those by editing jenkins.service. 
> In other words, I am advising systemd to set the proper values.
>
> The problem with that: Any update of Jenkins (of which there are quite a 
> few, thankfully) replaces the jenkins.service file, thus overwriting my 
> changes. In other words: After each update, I need to reapply my changes to 
> jenkins.service.
>
> Is there any better location for those values, that survives updates?
>
>
> There is a better location for those values and it will survive updates.  
> The "Managing systemd services" 
> <https://www.jenkins.io/doc/book/system-administration/systemd-services/> 
> page describes the "systemctl edit jenkins" command that creates a local 
> copy of the overrides file .  That copy is preserved across upgrades.
>
> Mark Waite
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1d618ff3-a490-4c7b-ae5b-04d5c7824b4bn%40googlegroups.com.

Reply via email to