* Jim Norton <jrn@oregonhanggliding.com> [Sep 23. 2003 01:54]:
Just don't kill the parent if the parent is INIT. That would be bad. :-)
... and fortunately it's not possible to kill init :)
So the kernel doesn't allow INIT to be killed by anything not of it's doing to prevent the system from being stopped if INIT was killed?
Well, the kill(2) syscall is just a program to send a signal to a process. So it's up to the program to implement proper signal handling. In the case of process 1 (init), there's the following note in kill(2): "It is impossible to send a signal to task number one, the init process, for which it has not installed a signal handler. This is done to assure the system is not brought down accidentally."
Does the kernel ever kill init itself ( for a reboot for example )? Or does it just enter a runlevel and sit and wait for the PC to reboot etc?
Well, what do you mean "if the kernel kills init"? At some point init tell the kernel it wants to reboot/shutdown, simply by doing all the preparation (nice shutdown of all processes etc.) and then when time permits, calls reboot(); It's good reading to take a stroll through the source-code for init and friends, if one wants to get acquainted with this stuff. -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J.