[plug] What happens...

Tom Atkinson tom at tyco.net.au
Tue Jul 6 22:37:08 WST 1999


Excellent question Oliver!

What should happen, as I understand it, and would like anyone more UNIX
expert to speak up if they differ, is as follows:

First of all, init, being the parent process of many others, is just
sleeping for most of the time.  It is the first process to execute on a
unix system and it starts up everything else - then it goes to sleep.

Being a parent, it gets awoken on "death of a child".  Upon awakening,
it checks if the particular child was one of those started via inittab,
and if so, may do something "special" with that particular task, such as
"respawn" it, then go back to sleep.

If the child was not started via inittab, for example when a child
"inherited" init, then init would do nothing but go back to sleep.

So, if init had been killed, those processes for whom init was the
parent would remain, in the process table, as zombies; this includes
those tasks normally "respawned" via inittab.

Given that the proper running of a unix system is dependent on the
inittab actions, the loss of init is considered a serious problem, but
should not be an immediately fatal one.

I would assume that the kernel has code that prevents certain signal
actions from occurring to PID 1, hence the kernel will deliver signals
such as "SIGHUP", but will not perform the SIGKILL action on init.


Oliver White wrote:
> 
> Ok, I'm curious...
> 
> what would happen if you executed the command 'killall -9 init'?
> 
> Anyone want to try and find out? :)
> --
> Oliver White


More information about the plug mailing list