I was looking at the recent Jenkins issues and saw JENKINS-68149, which states:
WAR file was moved from
/usr/lib/jenkins/jenkins.war
to/usr/share/java/jenkins.war
( or /usr/share/jenkins/jenkins.war
if looking at the change).
The following is a question to understand historic context and decision process for the change. Was this related to the systemd
changes or something else? Is there differing guidance for docker images vs package installation (into standard VM; ie: sudo yum install jenkins
?
I’ve always been perplexed why the default location for jenkins.war was /usr/lib/jenkins
and /var/lib/jenkins
for $JENKINS_HOME, since the jenkins binary is not really a libary. Equally perplexed why it’s now /usr/share/jenkins/jenkins.war
.
I’m only moderately familiar with the Linux Filesystem Hierarchy Standard or if it’s even applicable. I’m honestly not sure there’s any standard (though I’m sure there is one that’s happily ignored by java devs) as to how the FHS is extended for java apps. For example, is “java” considered the program and the binary (jenkins.war) is data?
The FHS says:
The /usr Hierarchy - 4.1. Purpose
/usr
is the second major section of the filesystem. /usr
is shareable, read-only data. … Any information that is host-specific or varies with time is stored elsewhere.
4.6. /usr/lib : Libraries for programming and packages
4.11. /usr/share : Architecture-independent data
The /usr/share
hierarchy is for all read-only architecture independent data files
It would be my interpretation of the FHS to have seen the binary installed in /opt/jenkins/
and the “data” ($JENKINS_HOME) in /var/opt/jenkins
, with configuration in /etc/opt/jenkins
or /etc/systemd/system/jenkins
.
3.13. /opt : Add-on application software packages
5.12. /var/opt : Variable data for /opt
3.7.4. /etc/opt : Configuration files for /opt
This would be consistent with the implementation of:
PARAMS="--logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war"
In any case, anything inside /usr
seems like an unusual choice. Any explanations?