You don't have to do this yourself. catalina.sh understands the option -force. Before starting the Tomcat, set CATALINA_PID to some file path. The script will store the PID of the Tomcat process in that file. Now you can call "catalina.sh stop 10 -force" which will wait up to 10 seconds for Tomcat to shutdown before it kills the Tomcat process.
Greetings, Timo -----Ursprüngliche Nachricht----- Von: David Fisher [mailto:dfis...@jmlafferty.com] Gesendet: Freitag, 16. Juli 2010 04:27 An: Tomcat Users List Betreff: Re: Script to restart Tomcat I've found that you cannot always rely on the shutdown script closing tomcat quickly. If you have a thread that is not properly managed maybe not at all. In my restart scripts I find the PID of the tomcat process, run the shutdown script, sleep 10 seconds, test if the PID is still active and if so I kill it. It is then safe to run the startup script. That ought to work on any type of unix including Mac 10. Regards, Dave On Jul 15, 2010, at 2:47 PM, Jordan Michaels wrote: > Most restart scripts that I've seen for Tomcat are home-brewed. Just google > for Tomcat restart script and I'm sure you'll find something a bit more > advanced then what you're using below. > > Warm regards, > Jordan Michaels > Vivio Technologies > http://www.viviotech.net/ > Open BlueDragon Steering Committee > Railo Community Distributions > > On 07/15/2010 02:25 PM, laredotornado wrote: >> >> Hi, >> >> I'm using Tomcat 6.0.26 on Mac 10.6.3. I put this script together to try >> and restart Tomcat ... >> >> ==========Start restart.sh ============== >> sh /Library/Tomcat/Home/bin/shutdown.sh >> sh /Library/Tomcat/Home/bin/startup.sh >> ============End restart.sh ============= >> >> but what I'm noticing is that sometimes when the script is run, if there was >> only one Tomcat process running, there are now two Tomcat processes running, >> and I'm wondering if somehow the startup.sh script is being run before >> shutdown.sh has completed. >> >> My question is, is this true, or do you have a shell script to restart >> Tomcat cleanly? >> >> Thanks, - Dave >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org