Ok well this is one way to kill the tomcat processes, this is how I stop tomcat (yes, its dirty I know but it works 4 me).
First this is for a single tomcat server instance (worker):
#!/bin/bash
# Name: KT.sh
# Laurie Baker
# This kills off the Tomcat processes
# as tomcat objects to stopping when asked 'nice'
#
for PID in `ps -ef|grep tomcat| awk '{print $2}'`; do kill $PID ; done
# That feel-good factor..
ps -ef|grep tomcat|wc -l
Now if you have multipul workers, you need two of these KT1.sh & KT2.sh
#!/bin/bash
# Name: KT2.sh
# Laurie Baker
# This kills off the Tomcat 4-2 worker processes
#
for PID in `ps -ef
a w[ide]w[ide]w[ide] output of the ps, this allows you (well grep!) to identify the path for tomcat4-1 or tomcat4-2 (worker), this may not make sence if you have never tried running two (or more) tomcat servers on the same Application server "you should try it" with the AJP conector in Apache it loadbalances a treat.
But thats for another day.
Sorry I didn't make it clear b4, I (and I stress that this is my solution "and may not be the best" use this script to stop tomcat when I need to.
So where you would normaly use /usr/bin/tomcat4 start <cr> to start tomcat and /usr/bin/tomcat4 stop <cr> to stop tomcat, I continue to use the original /usr/bin/tomcat4 script to start it BUT I use /path/to/myscript/KT1 <cr> to stop tomcat "Where <cr> is the Enter key or Carrage Return as it used to be called".
I have found that if someone has a http connection open then stopping tomcat with the /usr/bin/tomcat4 stop leaves processes behind (as in your situation) my way kills them dead.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.