lkml.org 
[lkml]   [2002]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Init - how does it work?
Date
On Thursday 12 September 2002 07:27, Johan Brodin wrote:
> Hi!
>
> I am new to this list, so I will take one second to present myself.
> My name is Johan and I am a 23-year old student at Chalmers university of
> technology in Sweden. The reason for joining this list is that I am
> currently doing my Master Thesis Project in Computer Science and
> Engineering. My thesis is namned "Design of dependable distributed
> UNIX-based systems" and one issue that I am looking into is process
> supervision.
>
> I tried to configure init to start and respawn processes and this worked
> great, no problems at all, but what really would make me happy is if
> someone of all you subscribers to this list could explain how this feature
> (respawn) works. How is init told that it must respawn the process? and
> such things! If someone could find the time to help me out, I would be
> very grateful.

Well, I'd reccomend reading the sources...

But, the short answer is SIGCHLD. A process can get a SIGCHLD sent to it when
a child process terminates. Init maintains a list of child processes; when
it gets a SIGCHLD, it knows that one of them dies, and restarts it.
Obviously, this is somewhat oversimplified, but it's in general how to
occomplish these things.

Hope this helps. BTW, I'm pretty sure that this is coverred in a lot of
books. I'd start with the Stevens book (I don't remember the exact name of
it off hand, however; something like "Unix systems programming").

-Nick

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.063 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site