Hi, It works killall -1 init restarts the init process (for example the inittab file is re-read). (HUP) signal works, so "for which it has not installed a signal handler" is not true. Regards, Alin. Mads Martin Joergensen wrote:
* Jim Norton
[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.
-- Alin DOBRE Technical Support Engineer - RAV Division mailto:alin.dobre@ravantivirus.com http://www.ravantivirus.com --------------------------- This message is confidential. It may also be privileged or otherwise protected by work product immunity or other legal rules. If you have received it by mistake please let us know by reply and then delete it from your system; you should not copy the message or disclose its contents to anyone.