-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
2
-
False
-
False
-
Undefined
While looking into JWS-1841 I found that TOMCAT_CFG_LOADED is used in the logic of the /usr/libexec/tomcat/preamble script (and so is TOMCAT_CFG):
5 # Get the tomcat config (use this for environment specific settings) 6 7 if [ -z "${TOMCAT_CFG_LOADED}" ]; then 8 if [ -z "${TOMCAT_CFG}" ]; then 9 TOMCAT_CFG="$sysconfdir/tomcat/tomcat.conf" 10 fi 11 . $TOMCAT_CFG 12 fi
but not the bin/startup.sh or bin/catalina.sh, so that function is missing from the zip's systemd service unit. This variable was used in determining the loading order of the sysconfig and tomcat.conf files. The zip's systemd service unit does have an option to load the /etc/sysconfig/jws5-tomcat config but we don't ship it by default so it's not present unless users create it:
8 EnvironmentFile=@@@TCHOME@@@/conf/jws5-tomcat.conf 9 EnvironmentFile=-/etc/sysconfig/jws5-tomcat 10 11 ExecStart=@@@TCHOME@@@/bin/startup.sh
The "-" before the env file makes it optional and they get loaded in the order they're declared already which makes the load order config option useless IMO.
This variable was also used in the tomcat-digest.sh and tomcat-tool-wrapper.sh files to which would load the config before executing. As it stands right now, that isn't happening and the only thing being executed is bin/setenv.sh when those scripts are run.
There is one more descrepancy between the zip and rpm distro and that is the usage of TOMCAT_CONFD, parsed and utilized by the /usr/libexec/tomcat/preamble script, but not by {bin/startup.sh}} or bin/catalina.sh so if the users are expecting that to work it doesn't either.
I think we should clean up the variable (add it to the deprecated block at the bottom of the file), document it, and suggest users rely on bin/setenv.sh instead.