LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   respawn from inittab of process launched by a shell script (https://www.linuxquestions.org/questions/slackware-14/respawn-from-inittab-of-process-launched-by-a-shell-script-4175478474/)

Barx 09-25-2013 05:55 AM

respawn from inittab of process launched by a shell script
 
Hi all

I need to find a way to automatically respawn a process if it dies;

the best way should be to do it with init

the process is called through the shell (working) script /usr/local/bin/startsocket

I tried adding this line to inittab

myid:2345:respawn:/usr/local/sbin/startsocket

then to reload init configuration with kill -HUP 1

But the process don't start, and I get these lines in /var/log/messages

Sep 25 12:36:10 server2 init: Id "myid" respawning too fast: disabled for 5 minutes

I've searched on google, and the reason seems to be that the shell script forks launching the real process then dies, and init stops to try restarting the process.

Do you have any help?

Best regards

Alessandro Barisone

willysr 09-25-2013 07:43 AM

Have you tried using monit?

Barx 09-25-2013 08:25 AM

Thank for the suggestion I'll try it seems to be what I was looking for

Kind regards

Alessandro Barisone


All times are GMT -5. The time now is 04:40 PM.