How to restart a daemon after a crash

On Linux, I have a daemon and I want to start it at boot. If it crashes, I need to restart it.

One way I tried using / etc / inittab, but the problem I see is starting at different times and the message shows "Respawn too fast: Disabled for 5 minutes." I guess this is because the parent exits and only the child process exits to create the daemon. The parent's exit causes it to respawn.

Is there any way to get what I want to do.

+3


source to share


2 answers


Take a look at monit . This service will monitor your system and take care of broken services and more.

If you are using systemd

, you can specify that the service should be updated on interruption:



Restart=on-abort

      

See the article for more information .

+3


source


supervisor



Supervisor is a client-server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.

-1


source







All Articles