Re: ifconfig device down

From: Jesse Pollard (pollard@tomcat.admin.navo.hpc.mil)
Date: Fri Aug 04 2000 - 13:54:23 EST


"Richard B. Johnson" <root@chaos.analogic.com>:
> Hello network gurus!
>
> To make a clean reboot of a remote embedded system, I need to have
> <somebody> send a FIN to every connected hosts. In an interactive
> system, init usually kills all the tasks, which forces an exit().
> The kernel then closes all the sockets/fd's, etc. This usually is
> sufficient to have most of the connected hosts disconnect before
> the server crashes. This seems to be more time-related than anything
> else.
>
> In this embedded system, my home-made init does a kill(-1, 9) before
> it reboots, but this is not sufficient. No FINs are sent to connected
> hosts even if I sleep() a second after this.
>
> Also, the equivalent of `ifconfig eth0 down` does not close these
> sockets. I haven't mucked with routing yet.
>
> Does anybody know if there is a socket call (or any other way), to
> tell the network to disconnect __everybody__ __now__?
>
> The connected hosts do disconnect after the embedded system reboots.

<not really a network guru - for what it's worth>

What a normal shutdown does is to issue a kill(-1,15) first, then
wait 3-5 seconds (or when it finishes other stuff) before sending
the kill(-1,9). It also doesn't kill itself. The signal 15 gives
the daemons time to close the connections and exit. If they are not
finished by the time the signal 9 occurs, then they are forced out, and the
connections left open.

The open connections get closed when a error packet is sent back from
the rebooted system after the remote host sends a retry.

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

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



This archive was generated by hypermail 2b29 : Mon Aug 07 2000 - 21:00:13 EST