upstart as init in a chroot

Scott James Remnant scott at netsplit.com
Sun Mar 25 21:26:30 BST 2007


On Sun, 2007-03-25 at 13:54 -0400, Brian J. Murrell wrote:

> On Sun, 2007-25-03 at 18:37 +0100, Scott James Remnant wrote:
> > Upstart relies on being process #1 for various features to work, and
> > expects to be granted the special handling that the kernel gives to that
> > process.
> 
> Ahhh.  The kernel handles process #1 specially?  I did not realize this.
> I thought it was more just "convention" that init got pid #1 (by nature
> that it is the first process started.  What kind of special handling
> does process #1 get from the kernel.  Feel free to just point to kernel
> source and I can get into reading it if you like.
> 
Yes, the signal handling semantics are somewhat different, as well as
pid#1 receiving signals for events such as Ctrl-Alt-Delete and the
keyboard request signal.

This isn't the primary "special behaviour" that Upstart relies on
though.  All processes must have a parent process, those processes
spawned by init directly itself will have the parent as their own
process id.

But processes that spawn another, and die (aka "daemons") will be
reparented to be a child of pid#1.

And when they die, pid#1 (init) receives SIGCHLD for that process.

Without being pid#1, upstart would be unable to provide service
supervision for daemon processes, since it would never receive SIGCHLD
for them.

Scott
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20070325/cddfae27/attachment-0001.pgp 


More information about the upstart-devel mailing list