[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hotplug and ifup



On Mon, Mar 03, 2003 at 12:37:44PM +0900, Fumitoshi UKAI wrote:
> I've uploaded new hotplug yesterday.
> Anthony Towns wrote:
> > That aside, hotplug could quite easily call "ifup eth0=hotplug"; allowing
> > you to have "mapping hotplug" to handle any further details.
> I modified net.agent like this, but how do we configure 
> /etc/network/interfaces?  I can't find any documentation
> about eth0=hotplug for iface in ifupdown manuals.

Wow, that's dodgy. "ifup eth0=hotplug" sets the physical interface
to eth0 and the logical interface to "hotplug", then runs the mapping
scripts in the usual manner. Doing:

	mapping hotplug
		script /usr/lib/hotplug/deal-with-hotplug-devs.sh
		map eth0 eth0

as the first thing in your /e/n/interfaces, and:

	$ cat /usr/lib/hotplug/deal-with-hotplug-devs.sh
	#!/bin/sh

	if="$1"
	out=""
	while read phys log; do
		if [ "$phys" = "$if" ]; then out="$log"; fi
	done
	if [ "" = "$out" ]; then
		exit 1
	else
		echo "$out"
		exit 0
	fi

then eth0 will be treated normally when hotplugged, and other devices will
fail when hotplugged (because there's no "iface hotplug ..." line for them
to be configured as).

That's probably not terribly comprehensible.

Cheers,
aj

-- 
Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/>
I don't speak for anyone save myself. GPG signed mail preferred.

  ``Dear Anthony Towns: [...] Congratulations -- 
        you are now certified as a Red Hat Certified Engineer!''

Attachment: pgpev9VTfOOPC.pgp
Description: PGP signature


Reply to: