I have a web application running as a jar, I need a automated way to restart this jvm with a reboot/crash.

What are you guys using for this? I am running ubuntu 10.04 lts . (Examples would be great)

Thanks

link|improve this question

71% accept rate
During a server reboot/crash or when the jvm crashes? – mahnsc Jun 11 '11 at 15:08
both would be ideal. – Joey Bagodonuts Jul 29 '11 at 2:56
feedback

1 Answer

Poor man's solution:

Make your Server create a proper pid file.

Create a bash script, that checks if a process with the pid number exists and if it doesn't starts it.

Then make a cron job that runs this bash script every minute.

(If it's running under Windows, substitute bash with batch script and cron job with an at job)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.