Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 4038  / 3 Years ago, wed, july 28, 2021, 10:22:44

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


More From » process

 Answers
1

I tried using supervise from daemontools with a crontab :



First, I start with



supervise /fullpath


and I use this crontab :



0 23 * * * svc -d /fullpath
2 23 * * * svc -k /fullpath
5 23 * * * svc -u /fullpath


Where fullpath is the directory containing the file called run which start my process. The tricky part is the file called should end with :



exec java ...


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.


[#32048] Friday, July 30, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
umplegitimat

Total Points: 137
Total Questions: 126
Total Answers: 118

Location: Saint Pierre and Miquelon
Member since Sat, Aug 21, 2021
3 Years ago
;