I run a process that sometime crash and sometime freeze. I used supervise to have it automatically restart when it crash. However, if it freeze, it stay frozen until I am back in front of the computer. I would like a tool that would restart it when it crash, but can also be configure to do periodic kill and restart, so if it freeze, it won't stay frozen more that a given period of time.
Which tool would who suggest?
Thanks
You could use cron to do this if you want...
Would kill and restart it every 5 hours. More examples... Cron examples
I tried using supervise from daemontools with a crontab :
First, I start with
and I use this crontab :
Where fullpath is the directory containing the file called run which start my process. The tricky part is the file called should end with :
Normally, I start the application with a script, but if I put that script in the file called run, when svc is executed, it send the signal to the script and the java process continue to run. I created a copy of the script and modified it to make it output the call to java with all parameter, and copied this in the file called run.