Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 178808 - Tomcat 5.5 init script 'stop()' not working: confused about --stop --exec
Summary: Tomcat 5.5 init script 'stop()' not working: confused about --stop --exec
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: William L. Thomson Jr. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-16 21:27 UTC by Mark H. Wood
Modified: 2007-05-17 21:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark H. Wood 2007-05-16 21:27:55 UTC
/etc/init.d/tomcat-5.5 doesn't stop Tomcat when told to 'stop'.  stop() tries to use 'start-stop-daemon --stop', which just sends SIGTERM to any identified process.  Tomcat seems to shrug this off.  The documented way to shut down Tomcat is to send a shutdown message to its control port, by running a command very like the one used to start it but passing 'stop' instead of 'start'.

The current script assembles the correct command but uses start-stop-daemon to execute it, which s-s-d will not do for --stop.  I think the whole start-stop-daemon command should be replaced with just '${JAVA_HOME}/bin/java ${OPTS_CP} ${CATALINA_ARGS} ${STD_OUT} stop'

Reproducible: Always

Steps to Reproduce:
1./etc/init.d/tomcat-5.5 start
2./etc/init.d/tomcat-5.5 stop

Actual Results:  
Step 2 says "[ok]" but Tomcat is still running

Expected Results:  
Tomcat stops all webapps and exits cleanly.
Comment 1 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-05-16 21:58:58 UTC
Well you are the first to report this, and it's been in use for some time on quite a many systems. How long did you wait after issuing the stop command did you check to see if Tomcat is still running?

Shutdown is not instant and at times it takes a while. Why? Well just as you stated, to shut it down a request must be sent. That request has to be processed, servlet's destroy functions called and allowed time to clean up and do their thing. Much less for Tomcat itself to do the same with it's webapps, and etc.

FYI, catalina.sh is WAY worse at doing shutdowns. But don't take my word there, take the authors of Tomcat the Definitive Guide's word. They have their own init script I have considered porting to Gentoo. As mentioned on the Tomcat Guide, but here is link for reference.
http://www.webdroid.org:8080/repo/viewcvs.cgi/tomcat-package/trunk/bin/

So not going to close right way, but likely will as invalid. Unless it's something I can reproduce, and all other Tomcat users. Which 5.5.x has been stable for quite some time. So should have had many reports about this some time ago when it was in ~arch, much less during stabilization, or afterward.
Comment 2 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-05-17 21:19:54 UTC
Going to close this bug as I can't reproduce. As part of bug 162379, I along with others tested stopping. Seeing as how there are no other reports, this might be a local issue. If you are deploying your own apps, possibly a problem with them, or their destroy functions or something along those lines.

If you can provide a way for me and others to reproduce we can re-open bug and explore it further. Closing for now as invalid.