From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: how does udev rename an interface?
Date: Sun, 26 Dec 2004 12:33:21 +0000 [thread overview]
Message-ID: <1104064401.16548.12.camel@localhost.localdomain> (raw)
In-Reply-To: <20041226112849.GA8995@fishbowl>
On Sun, 2004-12-26 at 12:28 +0100, martin f krafft wrote:
> udev has the ability to rename network interfaces. At least on my
> system, udevsend is called from /etc/hotplug.d/default. A network
> device usually triggers two hotplug events, the first for the
> device, and the second for the network interface. Therefore, udev
> runs twice, but network interface renaming only makes sense during
> the second invocation, since it only applies to network interfaces.
>
> I have two questions about how udev handles this:
>
> - /etc/hotplug.d/net/*.hotplug are run before udevsend is called
> from /etc/hotplug.d/default. Thus, if a tool such as ifplugd
> already configures the network interface with
> /etc/hotplug.d/net, udev effectively cannot change the
> interface name because the interface is in use.
Right, if something brings up the netif earlier, udev can't do anything.
> - even if udev changes the interface name, how does it communicate
> the new name to net.agent and all the other hook scripts?The
> interface name is stored in $INTERFACE in the environment of the
> hotplug process, and udev cannot change that environment (or can
> it?).
On a successful rename, udev calls the /etc/dev.d/net/hotplug.dev
script, which calls the /etc/hotplug.d/default/default.hotplug again
with the corrected environment.
> How does udev deal with this?
If /sbin/udevsend is used as the hotplug helper and udevd manages the
complete hotplug event, only one correct hotplug netif call is visible
to the hotplug scripts. The one for the old name will be "converted" to
carry the new name and no second event needs to be faked.
Kay
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2004-12-26 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-26 11:28 how does udev rename an interface? martin f krafft
2004-12-26 12:33 ` Kay Sievers [this message]
2004-12-26 13:30 ` martin f krafft
2004-12-26 13:57 ` Kay Sievers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1104064401.16548.12.camel@localhost.localdomain \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).