Bug 695284

Summary: catalina.out path hard-coded in /usr/sbin/tomcat6
Product: Red Hat Enterprise Linux 6 Reporter: Jeremy Sowden <jeremy>
Component: tomcat6Assignee: David Knox <dknox>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: high    
Version: 6.0CC: awnuk, borgan, ddumas, jclere, jdennis, joshua, jscotka, roysjosh, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: noarch   
OS: Linux   
Whiteboard:
Fixed In Version: tomcat6-6.0.24-33.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 701759 (view as bug list) Environment:
Last Closed: 2011-05-19 10:58:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 701759    
Attachments:
Description Flags
proposed patch for initscript
none
proposed patch for wrapper (/usr/sbin/tomcat6) none

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