The Artima Developer Community
Sponsored Link

Java Buzz Forum
fast tomcat restart on Unix variants

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Marc Logemann

Posts: 594
Nickname: loge
Registered: Sep, 2002

Marc Logemann is founder of www.logentis.de a Java consultancy
fast tomcat restart on Unix variants Posted: Jul 30, 2006 10:53 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Marc Logemann.
Original Post: fast tomcat restart on Unix variants
Feed Title: Logemann Blog
Feed URL: http://www.logemann.org/blojsom/blog/default/?flavor=rss2
Feed Description: Marc's thoughts on Java and more
Latest Java Buzz Posts
Latest Java Buzz Posts by Marc Logemann
Latest Posts From Logemann Blog

Advertisement

Tired of restarting your webapps with Tomcat Ant Tasks or Tomcat Manager in development until tomcat starts to do crazy things?

add this to your .bashrc file:

skill ()
{
kill -9 `ps ax | grep $1 | grep -v grep | awk '{print $1}'`
}

And the write a small restart.sh script like that:

#!/bin/bash
. .bashrc
skill JavaVM
sleep 1
/usr/local/tomcat/bin/catalina.sh jpda start

On my system, i have only one process that has "JavaVM" in the process description and its most likely only on Mac OS X this way. Just use another string like "catalina" or "tomcat" instead of "JavaVM" as skill parameter.

You can call this bash script easily with "exec" Task with Ant. You can use the skill function also on the shell for easy trashing processes by name, just use "skill Safari" to kill Safari Browser. Of course it makes only sense for nun visual processes because otherwise its fast to kill them via GUI.

Read: fast tomcat restart on Unix variants

Topic: JSide 1.1 Previous Topic   Next Topic Topic: Time the Avenger

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use