Learn something new everyday
I’ve been wanting to create a simple script that would allow me to login to my server, kill the tomcat process and restart it. Of course I can do this manually, but it takes too many keystrokes.
I’m not a bash expert but I knew it could be gone. With a little help from Google, I came up with this:
echo "shutting down..." p=$(pidof java) kill -9 $p echo "restarting..." /opt/tomcat/bin/startup.sh
I needed the kill instead of the tomcat shutdown because shutdown doesn’t work when the JVM is froze (more on this problem later).
Now, combined with my newly installed TouchTerm on my iphone, I can do a quick restart from anywhere if I need to.
1 Total TweetBacks: (Tweet this post)
webmogul: Learn something new everyday http://tinyurl.com/8ywgb4 01/16/09 07:50am
Don’t miss anything, subscribe!
Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.


Comments
No comments yet.
Leave a comment