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.
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.
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?
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.
The reporter doesn't answer any more, other people stated that it works now. Please close this bug. Thanks! Ralph
Closing as per request in comment#4