[BusyBox] init: panic attempted to kill init

Chris Simmonds chris at 2net.co.uk
Wed Dec 18 12:40:28 UTC 2002


Hi,

Every now and again someone reports on this mail list the message 
"Kernel panic: Attempted to kill init!" when using busybox halt or 
poweroff commands. The message is output by the kernel in function 
do_exit in kernel/exit.c when it finds that it was called by init, i.e. 
current pid is 1.

The patch attached gets round the problem by forking a new process to 
call init_reboot (which eventually calls do_exit), so that init is no 
longer the current process at the crucial time. The patch works for me 
(Linux 2.4.19 on a i386) and now I can halt without the ugly message, 
and what's more control-alt-del is not disabled so I can reboot without 
having to cycle the power. As a matter of interest, does anybody know 
why the test for init is in do_exit in the first place? What is so bad 
about init calling reboot?

Chris.

-- 
Chris Simmonds                        2net Limited
chris at 2net.co.uk                      http://www.2net.co.uk/
Tel:   +44 (0)1962 869003             Fax:   +44 (0)870 056 7556
"If it's not connected, it's not effective"(tm)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: init.patch
Url: http://lists.busybox.net/pipermail/busybox/attachments/20021218/2254b1cb/attachment.diff 


More information about the busybox mailing list