Hi,
I was wondering how people who use Tomcat every day) do the stop/start
cycle that's required whenever something in WEB-INF/lib changes.
"./shutdown.sh ; ./startup.sh" is a bad idea, because Tomcat 3.x seems
to shut down it's threads asynchronously. So after shutdown.sh has
returned, Tomcat has not necessarily stopped. Then startup.sh comes
along, finds that your port is in use, and gives you "Address already in
use" errors.
With Tomcat 3.3, it is very easy to confuse Tomcat into thinking that it
has shut down (the ajp12.id file does not exist), but it actually
running. In this (common) situation, there is no way to kill tomcat
other than killing the processes ('killall java'). Killing tomcat in
this way is *very* dangerous, because it sometimes leaves threads in the
state described by 'man ps' as:
D uninterruptible sleep (usually IO)
Then you're plain screwed; the thread is completely unkillable even by
root, and is holding onto your tomcat port (8080). The only option is to
reboot the machine.
So anyway, has anyone got a safer way of restarting tomcat? Perhaps a
script that waits until Tomcat is *really* dead before restarting? It
would be nice if there was direct support in Tomcat for this everyday
task (a restart.sh script).
--Jeff