tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Subir Sengupta <>
Subject RE: strange shut down problem - solution?
Date Wed, 22 May 2002 18:15:19 GMT
This is definitely what is happening on my system, which is similar to yours
(Tomcat 4.0.3 on a linux box).  The problem seems to be with Tomcat starting
non Daemon threads in the WebappLoader and StandardLoader.  You could fix
that yourself and recompile and that may fix it. I'm going to try this when
I have some time. Of course, make sure that your app doesn't start non
Daemon threads.

The other options are to kill the threads like Mats' suggestion (kludgey,
but it works).  A simple 'killall java' works too.  You could also implement
a LifecycleListener that has a System.exit(0) statement as the last line in
the stop method.


-----Original Message-----
From: Cindy Ballreich []
Sent: Wednesday, May 22, 2002 9:01 AM
To: Tomcat Users List
Subject: RE: strange shut down problem - solution?

At 05:45 PM 5/21/02 -0700, Subir Sengupta wrote:
>This is a documented bug.  Apparently if there is a non Daemon thread
>running Tomcat won't shut down cleanly.

Hmmm. That sure sounds like what's happening on my system. I guess is called as daemon in the init.d script, but it's not starting
the threads as deamon. Is this what's happening?

At 10:13 AM 5/22/02 +0200, Mats Nyberg wrote:
>and a guru told me to
>  [tim-mn@spiderman src]$ ps -Af|awk '{ if ($3 == "1") { print ; } }' 
>|grep $JAVA_HOME|awk '{ print $2}'

This is basically the "solution" that I used. 
I added this line to the start section of my init.d script...
ps -Af | awk '{ if ($3 == "1") { print ; } }' | grep tomcat | awk '{ print
$2}' > /var/run/

And these lines to the stop section...
if [ -s /var/run/ ] ; then
    PID=`cat /var/run/`
    kill $PID

This works, but it seems like a horrible kludge to me. Does anyone have any
better solutions?


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message