Bug 237068 - tomcat 5 doesn't stop correctly
tomcat 5 doesn't stop correctly
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: tomcat5 (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Vivek Lakshmanan
tomcat-qe
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-19 05:31 EDT by Ralph Angenendt
Modified: 2012-05-21 07:29 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-21 07:29:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ralph Angenendt 2007-04-19 05:31:27 EDT
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 11:59:40 EDT
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 11:25:34 EDT
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 11:32:16 EDT
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 15:22:18 EDT
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 07:29:42 EDT
Closing as per request in comment#4

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