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
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
Makefile.in
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