Automatic restart of a crashing Linux daemon

4.3k views Asked by At

I have a Linux server application that I managed to "deploy" as a daemon that can be started automatically when the machine starts, independently of user sessions..

I wonder if it is possible to tell the system to automatically restart the application when it crashes, like the service manager in Windows..

Thank you in advance.

2

There are 2 answers

0
zerick On BEST ANSWER

Give it a look to monit, it monitors any service/daemon. You have to configure Monit in order to know what criteria to use to start/stop or email you in case something wrong/strange is going on.

1
RMo On

What you need is a process supervisor, a utility that manages your daemon and decides when to start/stop it among other things.

There are several of these out there such as supervisord, upstart, runit etc. You will have to research them and find one that best suits your needs.

Hope that helps.