I have a micro instance of ec2. A couple of java process’ gets killed every now and then.
Which tool can I run to monitor process and restart then when they get killed?
|
I have a micro instance of ec2. A couple of java process’ gets killed every now and then. Which tool can I run to monitor process and restart then when they get killed?
| |||
|
feedback
|
|
I don't think calling a pipeline of a few programs from a cron-job is the lightest way to monitor a service. The lightest way, in my opinion, is to use the init process to supervise your processes. Unfortunately the most popular /sbin/init implementation (SysVinit) cannot do that well. Upstart is much better at this task, systemd probably too. An alternative is a non-init process supervisor like the | |||||||
feedback
|
|
The lightest weight way would be just to have a cron job that runs every now and then, and starts the program if it's not already running. In most cases, a simple grep of ps will tell you if it's running:
| |||
|
feedback
|