Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This has been bugging me for a while.

In my JSF development cycle, I do a lot of tomcat reload and sometimes to the point of restarting tomcat. I notice that at times, shutting down tomcat using doesn't work, because when starting it via says the address is already in use for port 8080. And in the linux shell, I have to do something like this:

ps auwx | grep -i tomcat
kill -9 <tomcatPid>

Is there any way to be able to shutdown tomcat cleanly, like the the tomcat service in Windows ?

I'm currently using opensuse linux 11.2, and I don't add my tomcat onto my services yet. Still starting and shutdown it manually from the shell.

share|improve this question

migrated from Apr 5 '11 at 13:59

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

You can avoid 2 commands by simply running:

pkill -f catalina

to gracefully kill process matching with text catalina.

And to check whether catalina process is still running you can then do:

pgrep -fl catalina

And finally to kill with brute force try:

pkill -9 -f catalina
share|improve this answer

The clean way to shut it down is kill <tomcatPid>. That will start the JVM shutdown process including the servlet context destroy mechanism. On rare occasions the JVM will get stuck in the shutdown process and you will need to use kill -9 <tomcatPid> to kill the process.

So for example:

ps auwx | grep -i tomcat
kill <tomcatPid>
sleep 10   # This value is dependent how long it takes for your app to shut down
ps auwx | grep -i tomcat
if tomcat is still alive
    kill -9 <tomcatPid>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.