Re: halted system still working as router.

Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
30 Oct 1998 12:08:59 +0100


David Woodhouse <David.Woodhouse@mvhi.com> writes:

|> paul.hessels@sheridanc.on.ca said:
|> > The power in my apartment went out and my ups was about to fail. I
|> > typed "shutdown -h now" <enter>. The machine shutdown and halted. It
|> > said, The system is halted, and System Halted. My ups never did die.
|> > The curious thing was that when the power came back on I found that my
|> > computer was still routing traffic to the internet. Is this normal
|> > behaviors for a computer that has been halted? Is this a kernel
|> > problem, or specific to my machine(or my kernel)?
|>
|> It's always been the normal behaviour of the kernel, until someone changed it
|> recently in 2.1 kernels without documenting the reason for doing so.
|>
|> In 2.0, and most 2.1 kernels, 'shutdown -h' will kill all the user-space tasks,
|> but the kernel itself will remain alive. As routing is a simple function
|> performed by the kernel alone, it will continue to happen.
|>
|> I've been known to use this fact in embedded systems, which have a custom
|> /sbin/init which will set up the interfaces and enable routing, but then just
|> exits. (Crack that then)
|>
|> I keep asking why the behaviour was changed, but nobody seems to have owned up
|> to it yet, let alone given their reasons for doing so.
|>
|> In recent 2.1 kernels, you'll find that the kernel hangs completely after init
|> dies. So if you hit SysRq-L, which kills all tasks, you can't even sync and
|> unmount your disks before rebooting. I consider _that_ to be a bug.

Then why don't you just call reboot instead of exit in init?

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/