Description of problem: If one sets up an instance of tomcat by linking /etc/init.d/${NAME} to /etc/sysconfig/tomcat and setting instance-specific environment variables in /etc/sysconfig/%{NAME}, the script /usr/sbin/tomcat overwrites these by reading /etc/tomcat/tomcat.conf directly. Version-Release number of selected component (if applicable): 7.0.33-4 How reproducible: Setting up a second instance of tomcat and specifying evironment variables in /etc/sysconfig/${NAME} Steps to Reproduce: 1. ln -s /etc/init.d/tomcat /etc/init.d/foo 2. cp /etc/sysconfig/tomcat /etc/sysconfig/foo 3. echo 'CATALINA_PID=/var/run/foo.pid' >> /etc/sysconfig/foo 4. /etc/init.d/foo start Actual results: CATALINA_PID will be /var/run/tomcat.pid Expected results: CATALINA_PID will be /var/run/foo.pid Additional info: Can be fixed by removing these lines from /usr/sbin/tomcat: # Get the tomcat config (use this for environment specific settings) if [ -z "${TOMCAT_CFG}" ]; then TOMCAT_CFG="/etc/tomcat/tomcat.conf" fi if [ -r "$TOMCAT_CFG" ]; then . $TOMCAT_CFG fi
The workaround provided in additional information does not persist if the tomcat package is updated. My workaround was to add this to the top of /etc/tomcat/tomcat.conf: # Fix the problem by refusing to override stuff from /usr/sbin/tomcat HACK="BUG1104704"; if [ "$0" == "/usr/sbin/tomcat" ]; then return; fi This persists even if tomcat is updated. But hopefully this can be fixed in the next package update! If any help is required I don't mind assisting. Thanks.
Can two followups be considered verification of this bug? I'd love to see this fixed. My workaround was to put TOMCAT_CFG=/etc/syscongig/<NAME> in my /etc/sysconfig/<NAME> file.
https://github.com/csutherl/fedora-tomcat/commit/868fe0c I updated the wrapper to check to see if a configuration has been loaded yet similar to what fc22+ does with the systemd unit. If $TOMCAT_CFG_LOADED is empty, then it loads $TOMCAT_CFG otherwise it doesn't. The default behavior will only change if you set $TOMCAT_CFG_LOADED in the tomcat.conf (I've added it there by default also). Feedback welcome :)
Also note that I didn't updated the jsvc-wrapper because that block is already commented out and I didn't update the tool wrapper because it isn't used in a service (it should always be called as a binary).
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions
https://pkgs.fedoraproject.org/cgit/rpms/tomcat.git/commit/?h=el6&id=694a006
tomcat-7.0.70-2.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-3ff1f4485b
tomcat-7.0.70-2.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-3ff1f4485b
tomcat-7.0.70-2.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.
With this update, my workaround stopped working, and the core issue was not resolved.
It seems that tomcat.conf should not be setting CATALINA_PID. Because it is set here, the init script never gets a chance to set it to /var/run/${NAME}.pid.