Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

halted system still working as router.

1 view
Skip to first unread message

Paul

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to linux-...@vger.rutgers.edu
I was told to post this here, so here goes.

-P133 32meg RAM
-kernel 2.0.35
-ip masqs between the internet and my internal network.

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)?


--
--Paul
Linux: For IQs higher than 95 or 98 !

Def'n LILO(li-lo) n The most dangerous virus known to Microsoft.

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

Adam D. Bradley

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to Paul
On Wed, 28 Oct 1998, Paul wrote:

> 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)?

If your shutdown scripts don't delete routes or bring the interfaces down,
this is the normal, expected behavior. A "shutdown" in most distributions
involves syncing and unmounting all filesystems and terminating all
processes, but the interrupt handlers and bottom-half scheduler (the
things that do routing) stay active.

I know some people who use this trick to "hack-proof" their home
firewalls/routers: once the routes are set up, userspace shuts down
completely, so there are no root processes to hack ;-)

If this behavior is undesirable in your environment, modify your shutdown
scripts to delete the routes and down the interfaces.

Adam
--
You crucify all honesty \\Adam D. Bradley artd...@cs.bu.edu
No signs you see do you believe \\Boston University Computer Science
And all your words just twist and turn\\ Grad Student and Linux Hacker
Reviving just to crash and burn \\ <><
---------> Why can't you listen as love screams everywhere? <--------

Miquel van Smoorenburg

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to linux-...@vger.rutgers.edu
In article <cistron.3637...@sheridanc.on.ca>,

Paul <paul.h...@sheridanc.on.ca> wrote:
>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)?

Newer versions of sysvinit solved this. halt(1) has a flag that tells
it to shutdown all network interfaces before halting [-i]. Make
sure your shutdown script calls "halt -i" (or even "halt -i -p").
This is the default in Debian 2.0, I don't know about RedHat.

Mike.
--
"Did I ever tell you about the illusion of free will?"
-- Sheriff Lucas Buck, ultimate BOFH.

David Woodhouse

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to Paul

paul.h...@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.

---- ---- ----
David Woodhouse David.W...@mvhi.com Office: (+44) 1223 810302
Project Leader, Process Information Systems Mobile: (+44) 976 658355
Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
finger dw...@ferret.lmh.ox.ac.uk for PGP key.

David Woodhouse

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to Adam D. Bradley

artd...@cs.bu.edu said:
> If this behavior is undesirable in your environment, modify your
> shutdown scripts to delete the routes and down the interfaces.

Or 'upgrade' to 2.1.12x, which someone has broken, so it just hangs when init
dies.

David Woodhouse

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to Miquel van Smoorenburg

miq...@cistron.nl said:
> Newer versions of sysvinit solved this. halt(1) has a flag that tells
> it to shutdown all network interfaces before halting [-i]. Make sure
> your shutdown script calls "halt -i" (or even "halt -i -p"). This is
> the default in Debian 2.0, I don't know about RedHat.

Then later versions of the kernel broke it again.

New 2.1 kernels will hang as soon as init exits, and not even let you sync and
unmount the disks.

Matti Aarnio

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to David Woodhouse
David Woodhouse <David.W...@mvhi.com> wonders:
> paul.h...@sheridanc.on.ca said:
...

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

RFC 1122 and 1123: The system SHALL NOT BY DEFAULT route between
its interfaces. The 2.0 does violate those, and at it the routing
must be explicitely turned off. 2.1/2.2 by default do not route,
and to turn it on you need to do following command:

echo 1 > /proc/sys/net/ipv4/ip_forward

> ---- ---- ----
> David Woodhouse David.W...@mvhi.com Office: (+44) 1223 810302

/Matti Aarnio <matti....@sonera.fi>

Gregory Maxwell

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to Paul

Redhat should turn off forwarding as part of it's shutdown. If you are not
running Redhat or you turn on forwarding through a non-standard method
(i.e. not through linuxconf) then this is indeed normal, as the shutdown
only stops userspace.


On Wed, 28 Oct 1998, Paul wrote:

> I was told to post this here, so here goes.
>
> -P133 32meg RAM
> -kernel 2.0.35
> -ip masqs between the internet and my internal network.
>

> 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)?
>
>

> --
> --Paul
> Linux: For IQs higher than 95 or 98 !
>
> Def'n LILO(li-lo) n The most dangerous virus known to Microsoft.
>

Stefan Monnier

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to linux-...@vger.rutgers.edu
>>>>> "Gregory" == Gregory Maxwell <lin...@z.ml.org> writes:
> Redhat should turn off forwarding as part of it's shutdown. If you are not

Shouldn't shutdown scripts ifconfig-down the interfaces anyway ?
At least mine do,


Stefan

Andreas Schwab

unread,
Oct 30, 1998, 3:00:00 AM10/30/98
to David Woodhouse
David Woodhouse <David.W...@mvhi.com> writes:

|> paul.h...@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
sch...@issan.cs.uni-dortmund.de completely different"
sch...@gnu.org

0 new messages