Bug 636997 - Additionally Created Instances of Tomcat are broken / don't work
Summary: Additionally Created Instances of Tomcat are broken / don't work
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: tomcat6
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: David Knox
QA Contact: qe-baseos-daemons
: 678404 (view as bug list)
Depends On: 575341
Blocks: 676922
TreeView+ depends on / blocked
Reported: 2010-09-23 22:03 UTC by John Dennis
Modified: 2015-11-02 00:15 UTC (History)
9 users (show)

Fixed In Version: tomcat6-6_0_24-21_el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 575341
Last Closed: 2011-05-19 10:58:32 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0791 normal SHIPPED_LIVE Moderate: tomcat6 security and bug fix update 2011-05-19 10:58:07 UTC

Description John Dennis 2010-09-23 22:03:32 UTC
+++ This bug was initially created as a clone of Bug #575341 +++

Created attachment 401404 [details]
Patch in unified diff to modify script tomcat6 (is tomcat6-6.0.wrapper in source rpm).

Description of problem:

The current Tomcat init scripts provide the ability to create additional instances of Tomcat by
- creating a link with a new name to the standard Tomcat init script
- create a config file in /etc/sysconfig/
See description in /etc/sysconfig/tomct6 (lines 10 ff).

If you create an additional instance following these instructions, startup of the additional instance fails.

Version-Release number of selected component (if applicable):
Same is true for Fedora 12 and 11!

How reproducible:

Steps to Reproduce:
1. Install current tomcat binary package
2. created a link  /etc/init.d/tomcat6-dev to etc/init.d/tomcat6
3. created  /etc/sysconfig/tomcat6-dev and modify locations of program directories
4. created /usr/share/tomcat6-dev
5. created therein symlins conf, work, temp, webapps to resp. 
  separate dirs
6. copied standard conf files to new dir (besides tomcat6.conf)
7. Edit all configuration files to use a separte port, separat directory
   locations, etc.
Actual results:
service tomcat6-dev start  fails

Expected results:
service tomcat6-dev start  should start an additional instance.

Additional info:

Malfunctioning is caused by the following lines (lines 13-19) in /usr/sbin/tomcat6 (invoked by the init script after setting all required environment variables):

# Get the tomcat config (use this for environment specific settings)
if [ -z "${TOMCAT_CFG}" ]; then
  echo -n "TOMCAT_CFG wird auf /etc/tomcat6/tomcat6.conf gesetzt."

if [ -r "$TOMCAT_CFG" ]; then

By sourcing the standard configuration file the parameters, prepared by /etc/init.d/tomcat6 to be passed in using environment variables, become inaccessible. Removed those lines and it flies.

Upstream has comment out these lines in its newest version (jpp 6.0 - WIP) providing tomcat6-6.0.18-10.jpp6) (http://www.jpackage.org/browser/rpm.php?jppversion=6.0&id=6542) but not in its current version 5.0 providing tomcat6-6-0-26-1.jpp5 (http://www.jpackage.org/browser/rpm.php?jppversion=5.0-updates&id=8580)

--- Additional comment from jdennis@redhat.com on 2010-09-23 17:24:17 EDT ---

*** Bug 615529 has been marked as a duplicate of this bug. ***

--- Additional comment from jdennis@redhat.com on 2010-09-23 17:38:36 EDT ---

This bug has been open for 6 months. The fix is trivial.

The suggested patch comments out the offending code, I think it might be better to just delete the 8 lines, your choice.

It's critical to get this fixed, it's gating the deployment of some tomcat applications (e.g. pki-ca, pki-tks, pki-ocsp and pki-kra).

Please push a fix out for F-12, F-13, F-14 (rawhide) as soon as possible. I suspect the same problem lurks in RHEL6, after verifying that I'll clone this bug against RHEL6 as well.


Comment 2 David Knox 2010-09-29 21:21:59 UTC
Fixed and ready to commit on RHEL-6 branch. 6.0.24-16

Comment 5 John Dennis 2011-02-17 23:14:59 UTC
What's the status on this? The fix does not appear to be in RHEL 6 and it's causing the Certificate Server to fail on RHEL 6.

Comment 6 David Knox 2011-02-18 00:23:29 UTC
I don't think it's the same problem. I checked the source for /usr/sbin/tomcat6:
# Get the tomcat config (use this for environment specific settings)
#if [ -z "${TOMCAT_CFG}" ]; then
#  TOMCAT_CFG="/etc/tomcat6/tomcat6.conf"

#if [ -r "$TOMCAT_CFG" ]; then

Checking the init script, and these two blocks are not in the right order:

 # Get instance specific config file
if [ -r "/etc/sysconfig/${NAME}" ]; then
    . /etc/sysconfig/${NAME}

# Get the tomcat config (use this for environment specific settings)
if [ -r "$TOMCAT_CFG" ]; then

Change it to:

# Get the tomcat config (use this for environment specific settings)
if [ -r "$TOMCAT_CFG" ]; then

# Get instance specific config file
if [ -r "/etc/sysconfig/${NAME}" ]; then
    . /etc/sysconfig/${NAME}

and it should work.

RHEL-6 and RHEL-6_0-Z artifacts have been changed to the correct order.
tomcat6-6_0_24-20_el6 has been tagged

We need 6.0.Z == + to check in tomcat6-6_0_24-21.el6_0

Comment 7 John Dennis 2011-02-18 01:00:56 UTC
hmm ... the tomcat version on the machine we were having problems with is tomcat6-6.0.24-15.el6.noarch which is a few revisions back from what you reference above. I'm cc'ing Chandrasekar our QE engineer who reported the problem. He would know better than I about the package revisions on his test machine.

The version of /usr/sbin/tomcat6 definitely does not have the sourcing of the tomcat config commented out, e.g.

#if [ -r "$TOMCAT_CFG" ]; then

but that might be due to the wrong version being installed.

And the order of the tomcat config sourcing and instance sourcing in the initscript is correct on his system, once again this might be due to the tomcat version being installed.

Comment 8 John Dennis 2011-02-18 13:16:36 UTC

I just checked the RHEL 6.1 Nightlies, the current version of tomcat6 is 6.0.24-20. We should probably upgrade the machine and rerun the tests.

Comment 9 Andrew Wnuk 2011-02-18 23:57:00 UTC
*** Bug 678404 has been marked as a duplicate of this bug. ***

Comment 13 errata-xmlrpc 2011-05-19 10:58:32 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.