Bug 750381 - bad condition check for alternative CATALINA_HOME
Summary: bad condition check for alternative CATALINA_HOME
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: tomcat6
Version: 6.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: David Knox
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-31 21:30 UTC by Michael McEniry
Modified: 2015-11-02 00:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-01 16:15:09 UTC
Target Upstream Version:


Attachments (Terms of Use)
change condition to check for existence of CATALINA_HOME (546 bytes, application/octet-stream)
2011-10-31 21:30 UTC, Michael McEniry
no flags Details

Description Michael McEniry 2011-10-31 21:30:46 UTC
Created attachment 531044 [details]
change condition to check for existence of CATALINA_HOME

Description of problem:
/etc/init.d/tomcat6 has a bad condition check when using an alternative CATALINA_HOME. Specifically, during start(), it checks to see if "$CATALINA_HOME" does not match "/usr/share/tomcat6", in which case it calls makeHomeDir() and then *always* runs sed to change port numbers in server.xml (even though the comments suggest this should happen only if CATALINA_HOME does not exist).
An alternative CATALINA_HOME is necessary when multiple tomcat instances need different .../lib contents.


Version-Release number of selected component (if applicable):
tomcat6-6.0.24-33.el6.noarch


How reproducible:
Always when using an alternative CATALINA_HOME


Steps to Reproduce:
1. Create a new tomcat instance using an alternative CATALINA_HOME. (too many steps to list--the stupid makeHomeDir() function should handle this but does not)
2. Check timestamp of server.xml (even create a copy of it if you like).
3. Start the new tomcat instance.
3. Check new timestamp of server.xml. If you made a copy, then diff the 2 files to see if any of the port numbers (8005, 8009, 8080, 8443) changed.
  
Actual results:
New timestamp for server.xml.

Expected results:
Old timestamp for server.xml.

Additional info:
The attached patch changes the condition to check for existence of CATALINA_HOME.

Comment 2 RHEL Program Management 2011-10-31 21:49:03 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 3 John Dennis 2011-10-31 23:25:00 UTC
If you are creating a different tomcat instances you should be modifying CATALINA_BASE not CATALINA_HOME.

The reason is because CATALINA_BASE is the per-instance area and CATALINA_HOME is the package install area (which needs to be preserved). CATALINA_BASE overrides portions of CATALINA_HOME. You set CATALINA_BASE in /etc/sysconfig/$NAME

This should be closed as NOT A BUG.

Now, on the other hand is makeHomeDir() ill conceived? Yes. I believe in some versions of the tomcat6 packages (perhaps in Fedora) it was removed. David would be able to elaborate. But that's a separate issue from this bug.

Comment 4 David Knox 2011-11-01 16:15:09 UTC
What is stated in Comment 3 is correct. 
CATALINA_HOME should point to the installation, and CATALINA_BASE points to the instance locations {conf, webapps, work, temp}.

No one should depend on makeHomeDir. The systemv scripts should have never taken on the responsibility of creating additional instances. Especially now when systemv is being retired and systemd scripts are the default for the fedora tomcat6 (rawhide, f16, f15). The systemd scripts don't use makeHomeDir. Instead the user must copy the correct directories and set CATALINA_HOME and CATALINA_BASE correctly. In the case of systemd, there must also be a service file to match the new tomcat service. 

Perhaps in the near future we can provide a script to automate most of the tasks involved with creating additional services. But that would be a seperate bz and would be prioritized against other open bzs.

I'm closing this as it is NOTABUG


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