Fix for SuSE multiple hotplug network interfaces race condition?
From: Dan Harkless (usenet_at_harkless.org)
Date: 08/02/03
- Next message: Vic Ayres: "Re: Question about CheckInstall"
- Previous message: baskitcaise: "Re: Question about CheckInstall"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 1 Aug 2003 23:44:39 -0700
In SuSE 8.2, all USB and PCMCIA network interface hotplug events are
funneled through a single 1-line file, /var/run/hotplug/net. As
alluded to in /etc/sysconfig/hotplug, this causes serious race
condition problems if you have more than one hotplug network
interface:
> # At the moment we write HW descriptions at USB or PCI hotplug events, which
> # then can be read by the NET event. This may cause race conditions if you
> # plug several deveices at a time.
There's a hack in /sbin/hotplug to attempt to serialize USB network
interface hotplug events, but it doesn't always work. And there's not
even an attempt to serialize PCMCIA network interface hotplug events.
My company is developing an embedded Linux device, and during our
deployment test phase, we need to be able to boot the box (note it
must be at boot time -- we can't require an operator to plug in
devices one at a time) with four hotplug network interfaces attached:
1. Belkin F5D5050 on mobo's USB 1.1 port 1
2. Belkin F5D5050 on mobo's USB 1.1 port 2
3. Belkin F5D5050 on PCMCIA USB 2.0 card
4. IBM Token-Ring PCMCIA card
(These are in addition to a non-hotplug Ethernet interface built into
the motherboard.)
With SuSE's versions of the hotplug scripts, where all four of those
interfaces want to overwrite the the /var/run/hotplug/net file, with
unpredictable timing between them, often some interfaces won't come up
at boot time, and/or the system will freeze in the middle of a
shutdown/reboot because the race condition caused incorrect
information to get written to /var/run/hotplug/*remover* scripts.
Why are SuSE's hotplug scripts written this way? The copies of the
scripts on my Red Hat 9 system and at
<http://linux-hotplug.sourceforge.net/> don't use a
/var/run/hotplug/net file...
Has anyone made any attempts to fix the race conditions in the SuSE
system? I looked at the scripts for a long time and tried a few
things, but I couldn't see how to fix them, since the net.agent script
gets launched in parallel with the usb.agent and/or pci.agent scripts
(possibly multiple invocations of each), and there doesn't seem to be
any environment variables or commandline parameters available that
would allow you to match up a given net.agent script with its correct
usb.agent / pci.agent brother.
Oh, and one more question (sorry). Just above the lines I quoted
above from /etc/sysconfig/hotplug appear the lines:
> # In future hotplug will hopefully be able to know which piece of hardware is
> # behind a given network interface. But currently there is no easy way to get
> # this information easily.
"No easy way to get it easily" implies that it's possible, but hard.
;^> How can one relate the USB bus + port information seen in
/proc/bus/usb/devices to a given logical network interface name like
eth1, if you have multiple USB devices using the same driver?
-- Dan Harkless usenet@harkless.org http://harkless.org/dan/
- Next message: Vic Ayres: "Re: Question about CheckInstall"
- Previous message: baskitcaise: "Re: Question about CheckInstall"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|