Log location and WEBROOT changed after Jenkins upgrade

1,526 views
Skip to first unread message

Marco De Vitis

unread,
May 2, 2022, 3:14:45 PM5/2/22
to jenkins...@googlegroups.com
Hello,
I recently upgraded Jenkins from 2.263.4/2.303.3 to 2.332.2 on three CentOS 7 machines, using the official jenkins.io packages from the redhat-stable repository.
While Jenkins (since years!) always saved its log as /var/log /jenkins/jenkins.log, now it sends all log messages to syslog (/var/log/message) instead.
Was this an expected change?

What's more, I also noticed that a "%C" directory has been created in Jenkins' home which only contains a jenkins/war subdir and the contents I list below.

In the systemd service definition (/usr/lib/systemd/system/jenkins.service) indeed I now see:

--------------------
# Location of the exploded WAR
Environment="JENKINS_WEBROOT=%C/jenkins/war"

# Location of the Jenkins log. By default, systemd-journald(8) is used.
#Environment="JENKINS_LOG=%L/jenkins/jenkins.log"
--------------------

I tried performing a clean install on a fresh VM and the result is the same.
Is this a bug in the official Jenkins packages?
I suppose %C and %L were meant to be something else...
Can I safely change this configuration?

Can anyone please help me?
Thanks.

Here is the %C dir content:

# ls -1F /var/lib/jenkins/%C/jenkins/war/
bootstrap/
ColorFormatter.class
css/
executable/
favicon.ico
help/
images/
JNLPMain.class
jsbundles/
LogFileOutputStream$1.class
LogFileOutputStream.class
Main.class
MainDialog.class
Main$FileAndDescription.class
META-INF/
robots.txt
scripts/
WEB-INF/
winstone.jar

--
Kind regards,
  Marco

Mark Waite

unread,
May 2, 2022, 3:44:28 PM5/2/22
to Jenkins Users
On Monday, May 2, 2022 at 1:14:45 PM UTC-6 you wrote:
Hello,
I recently upgraded Jenkins from 2.263.4/2.303.3 to 2.332.2 on three CentOS 7 machines, using the official jenkins.io packages from the redhat-stable repository.
While Jenkins (since years!) always saved its log as /var/log /jenkins/jenkins.log, now it sends all log messages to syslog (/var/log/message) instead.
Was this an expected change?


Yes, that is an expected change.

The Jenkins 2.332.2 upgrade guide notes that Jenkins has switched from System V init to systemd.  Read more about it at https://www.jenkins.io/doc/upgrade-guide/2.332/

The Jenkins 2.332.2 changelog notes that Jenkins has switched from System V init to systemd.  Read more about it at https://www.jenkins.io/changelog-stable/#v2.332.1

The "What's new in Jenkins 2.332.2 livestream" notes that Jenkins has switched from System V init to systemd.  Learn more about it at https://youtu.be/JO0BSpVjUJ8

The "Managing systemd services" page in the Jenkins documentation gives more information about managing systemd services with Jenkins.  See https://www.jenkins.io/doc/book/system-administration/systemd-services/

The "Managing the systemd service on CentOS 7.9" video by Darin Pope provides more information at https://youtu.be/MkokjTQ2ngc?list=PLvBBnHmZuNQJeznYL2F-MpZYBUeLIXYEe
 
What's more, I also noticed that a "%C" directory has been created in Jenkins' home which only contains a jenkins/war subdir and the contents I list below.

In the systemd service definition (/usr/lib/systemd/system/jenkins.service) indeed I now see:

--------------------
# Location of the exploded WAR
Environment="JENKINS_WEBROOT=%C/jenkins/war"

# Location of the Jenkins log. By default, systemd-journald(8) is used.
#Environment="JENKINS_LOG=%L/jenkins/jenkins.log"
--------------------

I tried performing a clean install on a fresh VM and the result is the same.
Is this a bug in the official Jenkins packages?
I suppose %C and %L were meant to be something else...
Can I safely change this configuration?


Yes, you can change that configuration.  Per https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Specifiers , the '%C' should be expanded by systemd to be the system cache directory.  On my Red Hat Enterprise Linux 8 that is /var/cache.

Based on https://issues.jenkins.io/browse/JENKINS-68313, it appears that the CentOS 7 implementation of systemd does not support the '%C' specifier.  Replace it with the text for the cache directory on your operating system.

Mark Waite

Marco De Vitis

unread,
May 3, 2022, 4:27:13 AM5/3/22
to jenkins...@googlegroups.com
Il 02/05/2022 21:44, Mark Waite ha scritto:

> Based on https://issues.jenkins.io/browse/JENKINS-68313, it appears
> that the CentOS 7 implementation of systemd does not support the '%C'
> specifier.  Replace it with the text for the cache directory on your
> operating system.

Thank you very much Mark!
I have to say I actually tried searching in the release notes (and on
Google) but my searches were targeted at log location changes while this
is just a consequence of the systemd implementation, so no useful
results were returned. And searching for 'jenkins "%C"' on Google also
was not useful... but hey, this now returns this thread, so it will
hopefully be useful to someone else ;).

--
Kind regards,
  Marco

Reply all
Reply to author
Forward
0 new messages