Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)


share|improve this question
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

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)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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