tips for restarting java applications...

From: Paul Wiggins (pwiggins@cisco.com)
Date: Tue Aug 13 2002 - 07:42:32 EDT


Thanks to all who replied: I'll follow up with what we ultimately used.

Many inittab/cron suggestions:
John Riddoch, Henrik Mortensen, Steve Maher, Richard Sullivan,
- Try spawning it from inittab so init restarts it. Put a line like:
jv:234:respawn:/path/to/app -flags
into /etc/inittab and kill -HUP 1; it should start up automatically.

- try a simple cron entry that runs a script once every 15 minutes or s o
that looks likje:
ps -ef | grep yourjavaapplication
if $? -ne 0
then restart the app
else
exit

Unix mgmt tools: Sunmanager, Brian Konash,
-I recommend supervise, from http://cr.yp.to/daemontools.html.
In addition to your own shell script programs like monit or daemontools

-We've had great results using Bernstein's daemontools to restart java
applications after failure on a unix machine. Has logging too! Check out
http://cr.yp.to

To wrappers:
Robert Reynolds, Derek Olsen, Doug Winter,
-Write a wrapper script around the application and cron it to restart once
an
hour.
-A simple task would be to have the app write a pid file somewhere
and have a job running that looks for the existince of a process with the
id from the pid file. If no process with that id then start a new
process.
-while true, do, run-crappy-application, sleep 5, done :)
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:46 EDT