hush/init
Eric Andersen 2c1de61023 There have been many reports of init failing to reboot and/or failing to halt
over the years.  Well I finally took the time to track this down.  It turns out
that inside linux/kernel/sys.c the kernel will call
    machine_halt();
    do_exit(0);
when halting, or will call
    machine_power_off();
    do_exit(0);

during a reboot.  Unlike sysv init, we call reboot from within the init
process, so if the call to machine_halt() or machine_power_off() returns,                                       the call to do_exit(0) will cause the kernel to panic.  Which is a very
bad thing to happen.

So I just added this little patch to fork and call the reboot
syscall from within the forked child process, thereby neatly
avoiding the problem.

But IMHO, both calls to do_exit(0) within linux/kernel/sys.c
are bugs and should be fixed.

 -Erik
2003-04-24 11:41:28 +00:00
..
Config.in Yet another major rework of the BusyBox config system, using the considerably 2002-12-05 08:41:41 +00:00
halt.c Major coreutils update. 2003-03-19 09:13:01 +00:00
init.c There have been many reports of init failing to reboot and/or failing to halt 2003-04-24 11:41:28 +00:00
Makefile Completely rework the config system so that it no longer annoys me to work on 2002-04-12 12:05:57 +00:00
Makefile.in Move readlink, mktemp, run-parts and which to a new debianutils dir. 2002-11-11 03:00:12 +00:00
mesg.c Major coreutils update. 2003-03-19 09:13:01 +00:00
poweroff.c Major coreutils update. 2003-03-19 09:13:01 +00:00
reboot.c Major coreutils update. 2003-03-19 09:13:01 +00:00
start_stop_daemon.c Major coreutils update. 2003-03-19 09:13:01 +00:00