I'm looking for a standard way or best practice to keep a daemon started by an init.d
shell script alive.
Or even better, is there a way to keep it alive directly from /etc/init.d
?
Specifically, I have a daemon called dtnd
with and infinite loop that looks for down precess, if there are any, the daemon wake up them again. Also, I use the start-stop-daemon
tool in order to let the precess by run from a given system user.
I want to run this dtnd
daemon from startup. In order to achieve this behavior I created a init.d script that "wraps" the dtnd
file using start, stop and status commands.
I have 2 questions that I will like to solve:
Is there a way to achieve keeping alive some process from init.d shell script. Is an standard/best way practice?
It's recommended to keep a daemon alive with infinite loop? I guess it's better to use some tool like daemon to achieve that. It's correct?
Thank you so much for your time!