Bug 42951

Summary: In catalina.sh CATALINA_OPTS is used for both start and stop.
Product: Tomcat 6 Reporter: Andrey Polozov <Andrew_Polozov>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 6.0.10   
Target Milestone: default   
Hardware: All   
OS: All   
URL: http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/bin/catalina.bat

Description Andrey Polozov 2007-07-22 10:28:48 UTC
Looks like an old bug in startup scripts, which has been fixed around 5.5.20,
has been reintroduced (or hasn't been ported) in 6.0.X:
CATALINA_OPTS variable is used for stopping, while it's supposed to be used for
starting only:
------------------
elif [ "$1" = "stop" ] ; then

  shift
  FORCE=0
  if [ "$1" = "-force" ]; then
    shift
    FORCE=1
  fi

  "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
    -Dcatalina.base="$CATALINA_BASE" \
    -Dcatalina.home="$CATALINA_HOME" \
    -Djava.io.tmpdir="$CATALINA_TMPDIR" \
    org.apache.catalina.startup.Bootstrap "$@" stop
------------------

This makes impossible using JMX agent/jconsole as well as other tools which rely
on socket listening.

I'm not sure if catalina.bat does the same thing...

I guess the latest 5.5.X version of catalina.sh (and probably .bat) shall be
merged into 6.6.X tree...
Comment 1 Rainer Jung 2007-07-22 11:39:18 UTC
Thanks for reporting this.
Fixed in revision r558523 for TC 6.0.15.
Also ported to trunk and 5.0.x.