Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem shutting down tomcat

Status
Not open for further replies.

sunnyjassal

Programmer
Feb 19, 2003
16
US

i am having problems with shutting down tomcat
i am on a linux machine startup is no problem where in the bin folder
all i type is
./startup.sh

but when i type ./shutdown
i get
using CATALINA_BASE: /usr/tomcat416/tomcat
using CATALINA_HOME: /usr/tomcat416/tomcat
using CATALINA_TMPDIR: /usr/tomcat416/tomcat/temp
using JAVA_HOME: /usr/java/java1.4

after this the computer hangs and after a while i get this message:
Catalina.stop: java.net.ConnectionException: Connection timed out
Java.net.ConnectException: Connection timed out
and then the exception

does anyone know why i get this.. if so how do i fix this problem so i can shutdown tomcat manually rather than restarting my comp

thanx
 
A "Simple" way (but maybe not the correct way) is:

As root

@ThePrompt>for PID in `ps -ef| grep tom | awk '{print $2}'` ; do kill $PID ; done

or you could pop it in a script like:

#!/bin/bash
#
# This kills off the Tomcat worker
#
for PID in `ps -ef | grep tomcat | awk '{print $2}'`; do kill $PID ; done

# Now for that feel good feeling..
ps -ef | grep tomcat |wc -l



Now things get a bit more tricky if you have more than one tomcat running on the same server but it's not that difficult, lets say you have 2 tomcat directories /var/tomcat/tomcat1 & /var/tomcat/tomcat2

just modify the script(s) like this:

for PID in `ps -ef grep tomcat1 | awk '{print $2}'`; do kill $PID ; done

And
for PID in `ps -ef grep tomcat2 | awk '{print $2}'`; do kill $PID ; done

Note: the the ps adds the missing lines of a short ps and therefore will include the /var/tomcat/tomcat(1 or 2), grep then only finds lines the corresponding processes for the worker you want to stop.

As an aside you can also eliminate "your" grep tom by adding: ... -ef | grep tom | grep -v grep | awk .....

Ok nuff said
Good luck
Laurie
 
Sunny I'm having same problem did you ever figure out what was wrong? let me know asap if you can Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top