Bug 695284 - catalina.out path hard-coded in /usr/sbin/tomcat6
Summary: catalina.out path hard-coded in /usr/sbin/tomcat6
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: tomcat6
Version: 6.0
Hardware: noarch
OS: Linux
high
low
Target Milestone: rc
: ---
Assignee: David Knox
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
: 697504 (view as bug list)
Depends On:
Blocks: 701759
TreeView+ depends on / blocked
 
Reported: 2011-04-11 10:22 UTC by Jeremy Sowden
Modified: 2015-11-02 00:16 UTC (History)
9 users (show)

Fixed In Version: tomcat6-6.0.24-33.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 701759 (view as bug list)
Environment:
Last Closed: 2011-05-19 10:58:49 UTC
Target Upstream Version:


Attachments (Terms of Use)
proposed patch for initscript (3.54 KB, patch)
2011-04-28 18:01 UTC, David Knox
no flags Details | Diff
proposed patch for wrapper (/usr/sbin/tomcat6) (1.41 KB, patch)
2011-04-28 18:01 UTC, David Knox
no flags Details | Diff


Links
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 Jeremy Sowden 2011-04-11 10:22:34 UTC
Description of problem:

  In /usr/sbin/tomcat6 the output from org.apache.catalina.startup.Bootstrap is
  redirected to catalina.out.  When $1 is "start," the path is
  ${CATALINA_BASE}/logs/catalina.out; when $1 is "start-security" or "stop." the
  path is /var/log/tomcat6/catalina.out.

Version-Release number of selected component (if applicable):

  tomcat6-6.0.24-24.el6_0.noarch

How reproducible:

  Start and stop tomcat as another user than tomcat with an alternative $CATALINA_BASE.

Steps to Reproduce:
1. Clone $CATALINA_BASE:

  ( cd /usr/share && tar chf - tomcat6 ) | ( cd /tmp && tar xf - )

2. Start tomcat:

  CATALINA_BASE=/tmp/tomcat6 /usr/sbin/tomcat6 start

3. Stop tomcat:

  CATALINA_BASE=/tmp/tomcat6 /usr/sbin/tomcat6 stop

Actual results:

  Failed attempt to append output to /var/log/tomcat6/catalina.out:

 /usr/sbin/tomcat6: line 62: /var/log/tomcat6/catalina.out: Permission denied

Expected results:

  Sueccesful attempt to append output to $CATALINA_BASE/catalina.out

Additional info:

Comment 2 David Knox 2011-04-12 18:31:55 UTC
Fixed in tomcat6-6.0.24-26.el6_0

Comment 8 David Knox 2011-04-28 18:01:02 UTC
Created attachment 495622 [details]
proposed patch for initscript

Comment 9 David Knox 2011-04-28 18:01:35 UTC
Created attachment 495623 [details]
proposed patch for wrapper (/usr/sbin/tomcat6)

Comment 10 David Knox 2011-04-28 18:06:21 UTC
makeHomeDir should create and link the log directory when ${CATALINA_HOME} directory does not exist. I found makeHomeDir does indeed create /var/log/${NAME} but doesn't link ${CATALINA_HOME}/logs.

Comment 11 David Knox 2011-04-28 20:01:46 UTC
*** Bug 697504 has been marked as a duplicate of this bug. ***

Comment 12 David Knox 2011-04-28 22:25:37 UTC
The wrapper now takes two arguments. The second argument is ${TOMCAT_LOG}. Changes were made to the zstream earlier and have been made in tomcat6-6.0.24-33.el6.

Comment 13 John Dennis 2011-04-28 23:20:03 UTC
Hi David:

I think the proposed init patch has the same issues discussed in bug 697504.

Good catch on the makeHomeDir function. I took a quick look at makeHomeDir and
my first impression is it seems a bit dubious, possibly a relic from systems
which are not RPM based. I'll have to spend a bit more time understanding in
detail what it's attempting to accomplish. I'll follow up tomorrow.

Also, just noticed another problem (at least in the f15 branch) the login shell
is /bin/sh not /sbin/nologin despite the comment for 0:6.0.30-6. (Yes I realize this is a RHEL bz)

Comment 14 Jan Ščotka 2011-04-29 06:34:15 UTC
Hi,
the bug with login shell is solved by: 678671 
and I've tested it earlier, now I've tests it with .30 and seems that no regression back:
tomcat:x:91:91:Apache Tomcat:/usr/share/tomcat6:/sbin/nologin
From my point of view, nologin shell is okay
   Honza

Comment 16 John Dennis 2011-04-30 14:32:26 UTC
re comment #14

I committed the sin of making a comment about another distribution in this bug, sorry if that was confusing :-) The login shell bug is now filed against F15 in bug 701038

Comment 30 John Dennis 2011-05-03 19:44:32 UTC
re comment #27

Thank you David, sounds good.

Comment 34 errata-xmlrpc 2011-05-19 10:58:49 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.

http://rhn.redhat.com/errata/RHSA-2011-0791.html


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