Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have got some problems with my tomcat instance. I am using apache-tomcat-6.0.20 for linux.My OS is CENTOS

when I execute command

# bin/shutdown.sh

It does not close the process that is running the tomcat.

Can any body please give me some idea; what is happening with the process.

share|improve this question
add comment

3 Answers

I've seen this problem a few times with Tomcat. A couple of things that might help:

  1. Give it some time to make sure the process really isn't shutting down; the Tomcat shutdown script tries to do a clean shutdown, and that can take a while if the Tomcat server had a large number of threads open when you called the shutdown script. If it takes more than 5 to 10 minutes, you probably have some other issue.
  2. Look in the log file (usually logs/catalina.out under the main Tomcat directory) - 9 times out of 10 you'll at least get a pointer to the underlying problem. Go head and post the error message here if you need more help.
share|improve this answer
    
+1. Mine takes forever, too. –  Matt Simmons May 11 '10 at 16:05
add comment

Does your system fail to shutdown? (ie: Hang?) If not, then it's definitely shutting down the process, just not in the way you might want. And was the startup script something you wrote, or came in a package? Is it correct to assume you've done some work with the /etc/init.d scripts? You're going to want to give us a bit more infomation.

Odds are, you need to have the process registered with chkconfig. Just putting Kscripts in /etc/rc#.d/ isn't sufficient, as I don't believe they get called if chkconfig doesn't know about them.

Essentially, your script needs lines at the top stating

# chkconfig: 345 99 10
# description: This is what my script does.

The first line states the runlevels this should be started on, as well as the priority startup and shutdown levels. (It would create S99 scripts in /etc/rc3.d, /etc/rc4.d, and /etc/rc5.d, and K10 scripts in all the rest)

On top of this, chkconfig will do a check in /var/lock/subsys/ to see if there's a lockfile out there for your service. So touch a file the same name as your service in that directory when it starts, and remove it when it quits.

Assuming you've got the above items in your script, it must be registered with chkconfig. In order to add a script, do chkconfig --add <name>. Just make sure the script is in /etc/init.d/ with the proper name.

share|improve this answer
    
Hi I have created a deploy script which is designed to copy war file from a predefined network location and deploy it in the tomcat location. This script first try to shutdown the tomcat process by calling "bin/shutdown.sh". Then it removes old war file from the webapp folder. After this script moves and copy war file. Once the war file is copied in the webapp folder, it tries to restart the tomcat server. But it fails; because it does not stopped on last shut down call. To shutdown and start tomcat I am using scripts found in package. –  vijay.shad Feb 24 '10 at 7:25
    
Vijay does Tomcat shutdown if you manually run bin/shutdown.sh, or will Tomcat not shutdown irrespective of whether you ask it to manually or via your deployment script? –  David Harrison Mar 26 '10 at 2:32
add comment

Do you have profiling installed? Tomcat has a known issue with profiling in that it doesn't shut down properly if it is installed. There is a work-around mod to the shutdown.sh script but I am still looking for it myself. This is in Tomcat 7, don't know if it's also in Tomcat 6.

share|improve this answer
add comment

Your Answer

 
discard

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