Bug 189670 - Udev spawns dhclient twice simultaneously
Udev spawns dhclient twice simultaneously
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2006-04-22 08:52 EDT by David Anderson
Modified: 2014-03-16 22:59 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-06 11:49:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Anderson 2006-04-22 08:52:12 EDT
Description of problem:
After inserting my PCMCIA wireless card, udev spawns dhclient twice.

Version-Release number of selected component (if applicable):

How reproducible:
Every time

Steps to Reproduce:
1. Insert Atheros-based PCMCIA card into laptop
2. ps -efH
Actual results:

% ps -efH

root       408     1  0 11:47 ?        00:00:00   /sbin/udevd -d
root      4118   408  0 13:51 ?        00:00:00     /sbin/udevd -d
root      4122  4118  0 13:51 ?        
00:00:00       /bin/bash /etc/sysconfig/network-scripts/ifup-eth /etc/sysconfig/netwo
root      4254  4122  0 13:51 ?        00:00:00         /sbin/dhclient -1 -q 
-cf /etc/dhclient-ath0.conf -lf /var/lib/dhclie
root      4119   408  0 13:51 ?        00:00:00     /sbin/udevd -d
root      4125  4119  0 13:51 ?        
00:00:00       /bin/bash /etc/sysconfig/network-scripts/ifup-eth /etc/sysconfig/netwo
root      4243  4125  0 13:51 ?        00:00:00         /sbin/dhclient -1 -q 
-cf /etc/dhclient-ath0.conf -lf /var/lib/dhclie

Expected results:
Only spawn once.
Comment 1 David Anderson 2006-04-22 08:53:38 EDT
Would have been more accurate to say that udev is spawning ifup-eth twice (as 
dhclient is invoked by this).

As this is a wireless card, I'm surprised that it spawns this at all (I'd 
expect it to spawn ifup-wireless instead).
Comment 2 Bill Nottingham 2006-04-24 23:40:28 EDT
ifup-wireless is a secondary script, not a toplevel script.

If you run udevmonitor, do you get one or two events?
Comment 3 David Anderson 2006-04-26 06:54:04 EDT
Looks like two events:

[root@shed david]# /usr/sbin/udevmonitor
udevmonitor prints the received event from the kernel [UEVENT]
and the event which udev sends out after rule processing [UDEV]

UEVENT[1146049188.525994] add@/class/net/wifi0
UEVENT[1146049188.526015] add@/class/net/ath0
UDEV  [1146049188.582723] 
UDEV  [1146049188.590593] add@/class/net/wifi0
UDEV  [1146049188.612935] add@/class/net/ath0
Comment 4 David Anderson 2006-04-26 06:54:47 EDT
I think I meant to say "one event".
Comment 5 David Anderson 2006-04-26 06:55:57 EDT
Actually I'm not sure what I meant. Possibly because Madwifi-ng uses both 
"wifi0" (for the hardware) and "ath0" (for individual instances), initscripts 
is having a problem with this.
Comment 6 Bill Nottingham 2006-04-26 12:38:21 EDT
Do you have both a wifi0 and ath0 ifcfg file with HWADDR in them, or only one?

Does the updates-testing initscripts change the behavior at all?
Comment 7 David Anderson 2006-04-27 05:48:20 EDT
I have these files:

[david@shed ~]$ ll /etc/sysconfig/network-scripts/ifcfg-*
-rw-r--r-- 3 root root 428 Apr 25 
12:55 /etc/sysconfig/network-scripts/ifcfg-ath0
-rw-r--r-- 3 root root 214 Nov  3 
15:02 /etc/sysconfig/network-scripts/ifcfg-eth0
-rw-r--r-- 1 root root 254 Jun 20  
2001 /etc/sysconfig/network-scripts/ifcfg-lo
-rw-r--r-- 3 root root 400 Nov  3 
15:02 /etc/sysconfig/network-scripts/ifcfg-OneTel
-rw-r--r-- 3 root root 337 Nov  3 
15:02 /etc/sysconfig/network-scripts/ifcfg-rausb0

Maybe this file is interesting too:
[david@shed modprobe.d]$ cat /etc/modprobe.d/madwifi
alias wifi0 ath_pci
alias ath0 ath_pci
options ath_pci autocreate=sta
[david@shed modprobe.d]$ rpm -qf /etc/modprobe.d/madwifi

What's changed in the updates-testing initscripts? I'm reluctant to try it as 
I can't afford any downtime.
Comment 8 Bill Nottingham 2006-04-27 13:46:34 EDT
Actually, the updates-testing changes are unlikely to affect this.

The problem is, you get two events (for wifi0 and ath0), and for each event, we
look at the hardware address for the device that's added (it's the same in both
cases). We then look for a config file that matches that hardware address, so we
try to bring up ath0.

In theory, dhclicent is supposed to prevent itself being brought up twice for
the same device; I'll have to check that locking.
Comment 9 David Anderson 2006-05-12 09:00:31 EDT
"The problem is, you get two events (for wifi0 and ath0), and for each event, 
we look at the hardware address for the device that's added (it's the same in 
both cases). We then look for a config file that matches that hardware 
address, so we try to bring up ath0."

Could this be solved by initscripts spotting that:
a) wifi0 has no wireless extensions
b) ifcfg-ath0 has details for a wireless device

[david@shed ~]$ /sbin/iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"(snip)" Nickname:"shed"
          Mode:Managed  Frequency:2.462 GHz  Access Point: (snip)
          Bit Rate:24 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=44/94  Signal level=-51 dBm  Noise level=-95 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
Comment 10 David Anderson 2006-05-24 04:26:37 EDT
I've noticed that two dhclients are only spawned sometimes - other times, one 
notices that the other already exists. Some kind of race condition?

Anyway, surely spotting that wifi0 has no wireless extensions and that 
ifcfg-ath0 is a wireless thingy ought to be sufficient?
Comment 11 Miloslav Trmač 2006-07-29 18:26:21 EDT
The dhclient locking is certainly racy - but ideally initscripts shouldn't even
try to run ifup twice; the code is probably not idempotent.

Just filtering out devices without wireless extensions would break all wired
ethernet devices, so we can't do that; and by the time wifi0 is added, ath0
might not be present yet if I understand the situation correctly.

You should be able to workaround the problem by removing the HWADDR= line from
Comment 12 David Anderson 2006-08-03 10:37:05 EDT
There isn't a visible "problem" that needs working around - 
everything "works". It's only running "ps" that tells me that there's some 
low-level defect that you guys have something you probably want to fix.
Comment 13 Bug Zapper 2008-04-03 22:43:36 EDT
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers
Comment 14 Bug Zapper 2008-05-06 11:49:53 EDT
This bug is open for a Fedora version that is no longer maintained and
will not be fixed by Fedora. Therefore we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen thus bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.