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
tomcat4-2| awk '{print $2}'`; do kill $PID ; done
# That feel-good factor..
ps -ef
tomcat4-2|wc -l
Ok the diference here is the use of ps -ef
the
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.
I hope this helps
Good luck
Laurie