This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I can hit ctrl-c with the best of them. When I do this, I see a bunch of messages about things gone bad and then a window pops up wanting to know if I want to notify microsoft about my system problems.
I would like to make a batch file that I could put in my project called bounce.bat. It would tell tomcat to gracefully shutdown and block until tomcat was all done. Then it would call "ant deploy" - where I would pretty much delete everything in the tomcat webapps directory, then drop a fresh war file. Then it would start tomcat back up.
Here's one that I use. It does it the opposit way from what you just described (the ant script calls the shell/batch script) Like yourself, I feel more comfortable with a complete shutdown of Tomcat. Since I'm doing that, I never needed to install the ANT tasks for deploying.
This script probably does more than what you want so you'll have to weed out what's junk to you:
Deletes the current copy of the application
Pulls the entire project from CVS to the scratch directory
Does some string replacement (version numbers, connection strings, etc)
Compiles all the Java classes (by calling nested build scripts)
Jars up all the class files and deletes the source (this removes the temptation to make a fix on the build server instead of doing in the developer's environment and checking it into CVS)
Packs everything into a war file.
Calls a shell script that restarts Tocmat
CD tomcat/bin ./shutdown.sh ./startup.sh
Sleeps for a while, giving tomcat a chance to wake up and deploy the new war file.
Moves some non-shipping files into directories within the app.
sample.build.xml I'm sure an ANT guru could show me better ways to do some of this stuff but it does what I need.
At least one of the tags was a problem for the forum software and it would have been too time consuming to figure out which so I provided a link to it instead.
For a winders box you just need to change the ./startup.sh to startup etc. Or... If you're running Tomcat as a service, you can use: net stop TOMCAT_SERVICE_NAME net start TOMCAT_SERVICE_NAME [ January 13, 2006: Message edited by: Ben Souther ]
You can get the service name by looking in the properties window from the services screen. I just looked on one of our windows boxes and it's "Tomcat5" [ January 13, 2006: Message edited by: Ben Souther ]
I have a question about running shutdown.bat immediately followed by startup.bat Typically my Tomcat takes quite a while to go through the shutdown routine so I always wait till it vanishes from the processes list. Is it safe to start a new instance with startup.bat while the old one is still shutting down? Bill