You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joe Tomcat <to...@mobile.mp> on 2002/09/01 01:49:54 UTC

Tomcat shutdown delay

I notice that when I do bin/shutdown.sh, the script returns fairly
quickly, but it takes a few seconds longer for the catalina processes to
actually go away.  Ie, if I do shutdown.sh and then ps auxw| grep
catalina, I still see a bunch of threads.

Is there a way to get the shutdown.sh script to block until catalina is
completely done and the jvm has exited?  The reason I am interested in
this is that I want to automate some things and some tasks need to wait
until tomcat is completely done.  Right now I have a sleep 15 in my
script, which seems to work, but I would rather have it so that it knows
definitively that tomcat is shutdown and also so that it doesn't wait
any extra time.

Thanks!





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat shutdown delay

Posted by Milo Hyson <mi...@cyberlifelabs.com>.
I had the same concern a while back, so I wrote a little script that does the 
following:

1) Execute shutdown.sh.
2) Poll netstat once per second waiting for the listening socket (e.g. port 
8080) to close.
3) Execute startup.sh.
4) Poll netstat once per second waiting for the listening socket to open.

I've made the script available at 
http://www.cyberlifelabs.com/milo/restart.sh. I apologize for it not being 
more flexible or robust. It does the trick for me and shouldn't be too hard 
to customize as needed.

- Milo Hyson
CyberLife Labs, LLC

On Saturday 31 August 2002 04:49 pm, Joe Tomcat wrote:
> I notice that when I do bin/shutdown.sh, the script returns fairly
> quickly, but it takes a few seconds longer for the catalina processes to
> actually go away.  Ie, if I do shutdown.sh and then ps auxw| grep
> catalina, I still see a bunch of threads.
>
> Is there a way to get the shutdown.sh script to block until catalina is
> completely done and the jvm has exited?  The reason I am interested in
> this is that I want to automate some things and some tasks need to wait
> until tomcat is completely done.  Right now I have a sleep 15 in my
> script, which seems to work, but I would rather have it so that it knows
> definitively that tomcat is shutdown and also so that it doesn't wait
> any extra time.
>
> Thanks!


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>