Slashdot/IBM: How To Speed Up Linux Booting

Erich Schubert erich.schubert at gmail.com
Wed Apr 11 14:33:46 UTC 2007


Hi,
> can you still rely on init being pid==1 ?

PID 1 is treated specially by the system.
For example, when Ctrl+Alt+Del is pressed, SIGINT is sent to the
process with PID 1.
I think if PID 1 quits, the kernel will try to restart it or even
panic or reboot.
So yes, init has to be the process with PID 1.

There are other benefits of PID 1. For example, when a process
detaches into the background, into a new session, it's new parent
becomes PID 1.
So an application running as PID 1 will receive SIGCHLD for any
'detached' process.
This is very useful for monitoring services, especially services such
as apache, which thoroughly detach. Workarounds present in some init
systems such as "pidfilehack" in minit
rely on this fact and won't work when init is not PID 1. You can run
minit as non-PID 1, but then it can't monitor e.g. apache. Services
that have an option to not background can be monitored for sure.
This is a reason why certain monitoring tasks are more efficiently
done by init than with an external monitoring application such as
monit.

best regards,
Erich Schubert
--
    erich@(mucl.de|debian.org)      --      GPG Key ID: 4B3A135C    (o_
  To understand recursion you first need to understand recursion.   //\
  Wo befreundete Wege zusammenlaufen, da sieht die ganze Welt für   V_/_
        eine Stunde wie eine Heimat aus. --- Herrmann Hesse



More information about the initscripts-ng-devel mailing list