Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-11-2004, 02:55 PM   #1
LQ Newbie
Registered: Feb 2004
Posts: 8

Rep: Reputation: 0
Post How to automatically respawn a process?

Hello guys, I am having a process which must be always online. That is, if it goes down it must be respawned as soon it is possible.
How can you accomplish this?
Iīve heard that you could do this with the inittab but apparently you canīt have much control over the respawning period. I am right about this? Could you alter this period?

Thanks a lot.
Old 06-11-2004, 03:02 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Take a look at Daemontools:
Old 06-11-2004, 03:29 PM   #3
LQ Newbie
Registered: Jul 2003
Location: MA, USA
Distribution: Mandrake,Debian,Zaurus
Posts: 17

Rep: Reputation: 0
A very simple way of doing it would be with a shell script in an infinite loop.

An example would be if your daemon was called foo, I'd write a script called

the contents would hold:

while true; do foo "$@"; done

so evertime the "foo" process dies, "" begins to execute again and then starts foo back up.

There are probably bunches of other ways to do it too.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a bash script to automatically disown a process. jon_k Linux - Software 5 06-19-2005 05:53 AM
CRON Process Won't Execute Automatically Transition Linux - General 5 01-14-2005 03:51 PM
If I want, that process has automatically started at system loading or reloading ukrainet Linux - Newbie 2 12-14-2004 09:39 AM
automatically starting process in Fedora Core 2 by using script falkesgaard Programming 1 07-29-2004 10:11 AM
process is getting killed automatically chens_83 Linux - General 2 09-16-2002 03:52 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:41 PM.

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