Tomcat and wrong path?

Problem:
While looking into a problem I stumbled across this in /etc/tomcat/tomcat.conf:

TOMCATS_BASE="/var/lib/tomcats/"

This folder is empty:

ls -l /var/lib/tomcats/
total 0

Is this correct?

Because /var/lib/tomcats/ has content:

ls -l /var/lib/tomcat/
total 0
drwxrwxr-x. 3 root tomcat 23 Nov 16 17:52 webapps

Expected outcome:
Working configuration.

Foreman and Proxy versions:
Foreman 2.4.0 with Katello 4.0

Distribution and version:
CentOS 7

Other relevant data:
No modification done, if not stated by the community or foreman-installer.

Well, just check the running tomcat:

# ps -ef | grep tomcat
tomcat    1345     1  0 May06 ?        01:36:22 /usr/lib/jvm/jre/bin/java -Xms1024m -Xmx4096m -Djava.security.auth.login.config=/usr/share/tomcat/conf/login.config -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat/temp -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start

As it says in the comment

# In new-style instances, if CATALINA_BASE isn't specified, it will
# be constructed by joining TOMCATS_BASE and NAME.

As NAME isn’t set, TOMCATS_BASE isn’t used, but only CATALINA_HOME which points to /usr/share/tomcat where you’ll find a symlink for webapps to /var/lib/tomcat/webapps.

1 Like

Yes, but why does it say /var/lib/tomcat’s’ instead of
/var/lib/tomcat ?
Is that not an error?

No. It’s not used so it’s not an error anyway.

When you run “new-style” instances you’ll put the instances into /var/lib/tomcats which creates cataline base like this:

    CATALINA_BASE="${TOMCATS_BASE}${NAME}"

If you don’t use new-style instances, i.e. you’ll only run a single instance in /var/lib/tomcat which is symlinked from /usr/share/tomcat. Foreman doesn’t use new-style instances so the whole /var/lib/tomcats directory isn’t used…

Thank you for the explanation.
Thread can be closed.