0

Is it more reliable to use daemontools or supervisord, or that I use crontab that runs a script of mine to keep checking if the process still exists and if not, start it again?

What is the best way to guarantee for sure that a process is always running, and running in a healthy condition? (i.e., it isn't running but stalled in some error, where it should be killed and started again).

Btw, this is a Java process that I start like java -jar app.jar.

Thanks!

PedroD
  • 4,310
  • 8
  • 38
  • 75

2 Answers2

1

We use monit for such tasks. It could run process if it is in down state

Yuriy Zhigulskiy
  • 1,134
  • 8
  • 10
1

Personally, I use supervisord for my servers. It's really easy to configure and understand, and it can be configured to automatically re-run a failing process several times.

You should probably start by reading the oficial docs, specifically, this section to set up start retries.