Bug 63871

Summary: Jakarta-Tomcat JVMs do not shut down properly
Product: [Retired] Red Hat Public Beta Reporter: Gil Chilton <gil.chilton>
Component: IBMJava2-JREAssignee: Preston Brown <pbrown>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: skipjack-beta2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-04-20 04:51:39 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:

Description Gil Chilton 2002-04-19 20:12:02 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Description of problem:
Skipjack2 prevents Jakarta-Tomcat (http://jakarta.apache.org/tomcat/index.html) 
from fully shutting down the Java JVMs.  This is demonstrated on two machines: 
1 a full install of Skipjack2 after previous Skipjack1 install and a different 
machine that was upgraded from Enigma to Skipjack2.  The shutdown worked 
correctly prior to Skipjack2.

They symptom is that some, maybe half, of the JVMs shutdown but not all.  If 
the shutdown script is run a second time, Java exceptions occur.  The scripts 
are below.


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


How reproducible:
Always

Steps to Reproduce:
1. Startup Tomcat with tomcat/bin/startup.sh
2. Wait for all processes to be started
3. Shutdown Tomcat with tomcat/bin/shutdown.sh
	

Actual Results:  Around 10 tomcat JVMs remain running after attempting to 
shutdown Tomcat.

Expected Results:  All JVMs stated by Tomcat should be shutdown when shutdown 
script is run.

Additional info:

Here is the startup script (tomcat/bin/startup.sh)which appears to work:
#!/bin/sh
# -----------------------------------------------------------------------------
# Start Script for the CATALINA Server
#
# $Id: startup.sh,v 1.1.4.1 2002/01/30 18:10:40 patrickl Exp $
# -----------------------------------------------------------------------------
 
# resolve links - $0 may be a softlink
PRG="$0"
 
while [ -h "$PRG" ] ; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '.*/.*' > /dev/null; then
    PRG="$link"
  else
    PRG=`dirname "$PRG"`/"$link"
  fi
done
 
PRGDIR=`dirname "$PRG"`
EXECUTABLE=catalina.sh
 
# Check that target executable exists
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
  echo "Cannot find $PRGDIR/$EXECUTABLE"
  echo "This file is needed to run this program"
  exit 1
fi
 
exec "$PRGDIR"/"$EXECUTABLE" start "$@"


Here is the shutdown script (tomcat/bin/shutdown.sh) which demonstrates the 
problem:

#!/bin/sh
# -----------------------------------------------------------------------------
# Stop script for the CATALINA Server
#
# $Id: shutdown.sh,v 1.1.4.1 2002/01/30 18:10:40 patrickl Exp $
# -----------------------------------------------------------------------------
 
# resolve links - $0 may be a softlink
PRG="$0"
 
while [ -h "$PRG" ] ; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '.*/.*' > /dev/null; then
    PRG="$link"
  else
    PRG=`dirname "$PRG"`/"$link"
  fi
done
 
PRGDIR=`dirname "$PRG"`
EXECUTABLE=catalina.sh
 
# Check that target executable exists
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
  echo "Cannot find $PRGDIR/$EXECUTABLE"
  echo "This file is needed to run this program"
  exit 1
fi
 
exec "$PRGDIR"/"$EXECUTABLE" stop "$@"

Comment 1 Gil Chilton 2002-04-20 04:51:34 UTC
I forgot to mention that I am using the Sun 1.4.0 JDK rpm, not the IBM JDK.

Comment 2 Gil Chilton 2002-04-22 13:36:42 UTC
Upon further review, the problem was my poorly designed threading code 
introduced about the time of Skipjack2 and not caused by Skipjack2.