LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-25-2013, 05:55 AM   #1
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 150

Rep: Reputation: 26
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
 
Old 09-25-2013, 07:43 AM   #2
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Have you tried using monit?
 
Old 09-25-2013, 08:25 AM   #3
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 150

Original Poster
Rep: Reputation: 26
Thank for the suggestion I'll try it seems to be what I was looking for

Kind regards

Alessandro Barisone
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Process dies when launched in system startup script carpannav Linux - Server 0 07-16-2013 11:44 AM
inittab respawn vs. rc?.d bitznarf Linux - Server 1 03-03-2011 05:53 PM
How to respawn a service, using respawn entry in /etc/inittab sampappachan_nyc Linux - Server 1 10-05-2010 04:58 PM
How to automatically respawn a process? lucasbl3 Linux - General 2 06-11-2004 03:29 PM
Kill a process launched by a shell script gsbarry Programming 7 01-06-2004 02:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration