From: Austin S Hemmelgarn <ahferroin7@gmail.com>
To: Shea Levy <shea@shealevy.com>, linux-kernel@vger.kernel.org
Subject: Re: Documentation for init
Date: Tue, 26 Aug 2014 08:34:09 -0400 [thread overview]
Message-ID: <53FC7EC1.9070401@gmail.com> (raw)
In-Reply-To: <20140826054837.GA2766@nixos.hsd1.nh.comcast.net>
On 2014-08-26 01:48, Shea Levy wrote:
> Hi all,
>
> Is there any official documentation of the init process? I'm
> specifically interested in the process state at kernel handoff (argv,
> envp, open fds, etc.) as well as any special properties pid 1 has
> (parent of all orphans, anything else?).
>
> Thanks,
> Shea Levy
>
> P.S. I am not subscribed to LKML, please CC me in responses
This is following is just my understanding based on what I have seen and
read, and I may well be totally wrong on some points (if that is the
case, I would love to know about it, I'm always trying to learn more).
As far as I can tell, the argv that gets passed to the init process is
the concatenation of all arguments on the kernel command-line that the
kernel doesn't recognize or parse. A lot of LiveCD's make use of this
to control hardware detection and module loading. The only open file
descriptors (i believe, I may be wrong) are 0, 1, and 2, all pointing at
/dev/console.
As for special properties:
* Parent of all orphans
* Doesn't have a session ID until it calls setsid() (not certain about
this one)
* Calling exit() will cause either a reboot or possibly a panic (I
think that this is dependent on the argument passed to exit())
* Not catching a fatal signal will cause a panic (this means that
sending SIGKILL and SIGABRT to PID 1 will always cause a panic).
* Has a PPID of 0, only other process like this is kthreadd
* Becomes the parent of most X programs (almost all of them dissociate
very quickly from whatever started them.
next prev parent reply other threads:[~2014-08-26 12:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 5:48 Documentation for init Shea Levy
2014-08-26 12:34 ` Austin S Hemmelgarn [this message]
2014-08-26 22:00 ` Rob Landley
2014-08-26 22:56 ` Rogelio Serrano
2014-08-28 11:37 ` Austin S Hemmelgarn
2014-08-28 18:25 ` Rob Landley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53FC7EC1.9070401@gmail.com \
--to=ahferroin7@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shea@shealevy.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox