Bug 237068 - tomcat 5 doesn't stop correctly
Summary: tomcat 5 doesn't stop correctly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: tomcat5
Version: 5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Vivek Lakshmanan
QA Contact: tomcat-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-19 09:31 UTC by Ralph Angenendt
Modified: 2012-05-21 11:29 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-21 11:29:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ralph Angenendt 2007-04-19 09:31:27 UTC
Description of problem:

When you try to stop tomcat 5 via "service tomcat5 stop", an incorrect
$JAVA_HOME gets set.

This has been reported as CentOS bug 1926 (http://bugs.centos.org/view.php?id=1926)

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

tomcat5-5.5.17-8jpp.2.x86_64

How reproducible:

Always

Steps to Reproduce:
1. service tomcat5 stop

  
Actual results:

Stopping tomcat5: Found JAVA_HOME: /usr/lib/java
Please complete your /etc/tomcat5/tomcat5.conf so we won't have to look for it
next time
Using CATALINA_BASE: /usr
Using CATALINA_HOME: /usr
Using CATALINA_TMPDIR: /usr/temp
Using JRE_HOME:
/usr/bin/dtomcat5: line 332: /usr/lib/java/bin/java: No such file or directory

Expected results:

tomcat5 stops cleanly.

Additional info:

The culprit seems to be in the dtomcat5 script:

 76 # Only set CATALINA_HOME if not already set
 77 [ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." ; pwd`

This sets CATALINA_HOME to /usr (cd /usr/bin/..). And as CATALINA_HOME is set in
line 77 in all cases, the tomcat config doesn't get sourced here:
 
 105 if [ -z "$CATALINA_HOME" ]; then
 106     [ -r "$TOMCAT_CFG" ] && . "${TOMCAT_CFG}"

That's why JAVA_HOME is off.

Comment 1 Ralph Angenendt 2007-05-08 15:59:40 UTC
The following has been added to the bug report at
http://bugs.centos.org/view.php?id=1926. Not sure if that references the same
problem, though ...


Tomcat init script is the issue here, I believe when doing the following:

for i in `grep -v "^#" /etc/tomcat5/tomcat5.conf |grep -v "^$"`; do
            j=`echo $i| sed 's/\"//g'`
            export $j
            options="${options} export $j ;"
done

the $i see the following JAVA_OPTS="-Xminf0.1 -Xmaxf0.3" like this

JAVA_OPTS="-Xminf0.1
-Xmaxf0.3"

as you can see it creates a new line for the second option. This then breaks the
export VAR.

this is not a " " issue as the JAVA_OPTS give above is the default example
supplied in the config file.

Comment 2 Vivek Lakshmanan 2007-05-18 15:25:34 UTC
http://rhn.redhat.com/errata/RHSA-2007-0327.html was released recently with
security fixes which upgraded the tomcat in RHEL 5 to 5.5.23 for security
reasons.  Could you check if the problem persists with the packages released as
part of this  errata?


Comment 3 Ralph Angenendt 2007-05-18 15:32:16 UTC
That looks much better on my side.

I'll ask the person who opened the bug in the centos.org bugtracker first,
though before I say "Close the bug". 

Thanks.

Comment 4 Ralph Angenendt 2007-05-25 19:22:18 UTC
The reporter doesn't answer any more, other people stated that it works now.
Please close this bug.

Thanks!

Ralph

Comment 5 Michal Haško 2012-05-21 11:29:42 UTC
Closing as per request in comment#4


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