Bugzilla – Bug 129648
startmode=ifplugd doesn't set resolv.conf
Last modified: 2007-06-05 09:37:16 UTC
I have two netcards: eth0+wlan0 (by default STARTMODE=onboot). When I set them to STARTMODE=ifplugd in YaST, after rcnetwork restart the eth0 gets an IP (cable is connected), but /etc/resolv.conf is empty. /etc/sysconfig/network/ifcfg-eth-id-00:0f:1f:a4:17:f6 BOOTPROTO='dhcp' STARTMODE='ifplugd' IFPLUGD_PRIORITY='20' /etc/sysconfig/network/ifcfg-wlan0 BOOTPROTO='dhcp' STARTMODE='ifplugd' IFPLUGD_PRIORITY='10' /etc/sysconfig/dhcp DHCLIENT_MODIFY_RESOLV_CONF="yes"
Your case seems a little bit strange, even if i found a bug regarding this. So how many dhcpcd and ifplugd are running at that time and with which options? I tried your setup and i found that rcnetwork restart really has a problem: ifdown (called in rcnetwork) returns before ifplugd has terminated. And in rcnetwork restart the next ifup follows very quickliy. This tries to start ifplugd for this interface, but this failed, because the old ifplugd is still running on this interface. I'll attach a patch in the next minutes.
Created attachment 54902 [details] let ifdown wait for ifplugd to terminate Michal, please apply this patch to /sbin/ifup and try again.
No change: glum:~ # patch -p0 < /home/msvec/ifup.diff patching file /sbin/ifup glum:~ # rcnetwork restart Shutting down network interfaces: eth0 device: Broadcom Corporation NetXtreme BCM5705M Gigabit Ethernet eth0 configuration: eth-id-00:0f:1f:a4:17:f6 done tun0 tun0 No configuration found for tun0 Nevertheless the interface will be shut down. tun0 configuration: done tun1 tun1 No configuration found for tun1 Nevertheless the interface will be shut down. tun1 configuration: done wlan0 device: Broadcom Corporation BCM4306 802.11b/g Wireless done Shutting down service network . . . . . . . . . . . . . done Setting up network interfaces: lo lo IP address: 127.0.0.1/8 done eth0 device: Broadcom Corporation NetXtreme BCM5705M Gigabit Ethernet eth0 configuration: eth-id-00:0f:1f:a4:17:f6 eth0 is controlled by ifplugd done tun0 tun0 No configuration found for tun0 unused tun1 tun1 No configuration found for tun1 unused wlan0 device: Broadcom Corporation BCM4306 802.11b/g Wireless LAN wlan0 is controlled by ifplugd done Setting up service network . . . . . . . . . . . . . . done glum:~ # cat /etc/resolv.conf glum:~ #
glum:~ # ifdown wlan0 wlan0 device: Broadcom Corporation BCM4306 802.11b/g Wireless LAN glum:~ # ifdown eth0 eth0 device: Broadcom Corporation NetXtreme BCM5705M Gigabit Ethernet eth0 configuration: eth-id-00:0f:1f:a4:17:f6 glum:~ # ifup eth0 eth0 device: Broadcom Corporation NetXtreme BCM5705M Gigabit Ethernet eth0 configuration: eth-id-00:0f:1f:a4:17:f6 Starting DHCP Client Daemon on eth0... . .IP/Netmask: 10.20.1.60 / 255.255.240.0 glum:~ # glum:~ # cat /etc/resolv.conf ### BEGIN INFO # ...etc, the correct contents
Please answer the questions from comment 1. Or better, after rcnetwork restart, show me: ps axw | grep "dhcp\|ifplug" grep -H "" /var/run/sysconfig/if* ip a; ip r ls /etc/resolv*
glum:~ # ps axw | grep "dhcp\|ifplug" 32589 ? Ss 0:00 /sbin/ifplugd -i eth0 -r /etc/sysconfig/network/scripts/ifplugd-selectif -f -I 380 pts/6 S 0:00 /sbin/dhcpcd -C -D -K -N -t 999999 -h glum -c /etc/sysconfig/network/scripts/dhcpcd-hook wlan0 453 ? Ss 0:00 /sbin/dhcpcd -C -R -G -N -Y -t 999999 -h glum -c /etc/sysconfig/network/scripts/dhcpcd-hook eth0 601 pts/6 S+ 0:00 grep dhcp\|ifplug glum:~ # grep -H "" /var/run/sysconfig/if* /var/run/sysconfig/if-eth0:link=yes /var/run/sysconfig/if-eth0:config=eth-id-00:0f:1f:a4:17:f6 /var/run/sysconfig/if-eth0:hwdesc=eth0 /var/run/sysconfig/if-eth0:status=connected /var/run/sysconfig/if-lo:config=lo /var/run/sysconfig/if-lo:hwdesc=lo /var/run/sysconfig/if-lo:status=connected /var/run/sysconfig/if-wlan0:link=yes /var/run/sysconfig/if-wlan0:config=wlan0 /var/run/sysconfig/if-wlan0:hwdesc=wlan0 /var/run/sysconfig/if-wlan0:status=connecting /var/run/sysconfig/ifup-eth0:up=yes /var/run/sysconfig/ifup-lo:up=yes /var/run/sysconfig/ifup-wlan0:up=yes glum:~ # ip a; ip r 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,NOTRAILERS,UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:0f:1f:a4:17:f6 brd ff:ff:ff:ff:ff:ff inet 10.20.1.60/20 brd 10.20.15.255 scope global eth0 inet6 fe80::20f:1fff:fea4:17f6/64 scope link valid_lft forever preferred_lft forever 3: sit0: <NOARP> mtu 1480 qdisc noop link/sit 0.0.0.0 brd 0.0.0.0 4: wlan0: <BROADCAST,MULTICAST,NOTRAILERS,UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:90:4b:73:11:62 brd ff:ff:ff:ff:ff:ff inet6 fe80::290:4bff:fe73:1162/64 scope link valid_lft forever preferred_lft forever 5: tun0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc pfifo_fast qlen 100 link/[65534] 6: tun1: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc pfifo_fast qlen 100 link/[65534] 10.20.0.0/20 dev eth0 proto kernel scope link src 10.20.1.60 169.254.0.0/16 dev eth0 scope link 127.0.0.0/8 dev lo scope link glum:~ # ls /etc/resolv* /etc/resolv.conf glum:~ #
This is curious. It work on my and also other machines. What does it do if you then unplug (wait some time) and plug the cable? Please set DEBUG=yes in /etc/sysconfig/network/config and attach syslog messages from a rcnetwork restart and unplug/plug cycle.
Created attachment 54943 [details] /var/log/messages This is /var/log/messages contents: logger XXX1 rcnetwork restart logger XXX2 unplug logger XXX3 replug cable logger XXX4
The interesting thing is that on wlan0 it seems to work OK, I resumed at home and got IP automatically along with correct resolv.conf. Strange.
No this is not strange. At home you have no link on eth0, therfore only wlan0 is active. There is now only one dhcpcd running and (that is important) it is running without -R -G -Y (== don't change _R_esolver, _G_ateway, _Y_pbind). This is because it is the first started dhcpcd. At SUSE the first dhcpcd is also running on wlan0 (without getting a lease) and on eth0 is a _secondary_ dhcpcd running with -R -G -Y. So far no problem; works as expected. The question that remains is _why_ there is a dhcpcd running on wlan0. The syslog from attachment 54943 [details] does not show that wlan0 was started (via ifplugd). And i can't beleive that you had the same sitiuation like in comment 6 when you took the lines from syslog. Joe, doe you see some wlan specific problems in attachment 54943 [details]? Michal, please check again. Look at what i asked for in comment 5 and comment 7 at the same time. Additionally call 'udevcontrol log_priority=6' before the test. Then, if you again have two dhcpcd, you must see in syslog when they were started. At least if ifup did it. Does 'rcnetwork stop; sleep 30; rcnetwork start' work? 30 seconds is very long, just to be very sure. Try shorter sleep if that works. Still a note: If you want to act as rcnetwork you have to call ifup with '-o rc'. And service network has to be started (i.e. first call rcnetwork start, then ifdown ... -o rc, then ifup ... -o rc and so on. I would like to debug myself. Maybe you can plug in an additional NIC and give me access. This situation is curious. Maybe some special problem with your Realtek device?
That 'rcnetwork stop; sleep 30; rcnetwork start' doesn't help either. Did the above test again, this is an output after 'rcnetwork restart': glum:~ # ps axw | grep "dhcp\|ifplug" 22884 ? Ss 0:00 /sbin/ifplugd -i eth0 -r /etc/sysconfig/network/scripts/ifplugd-selectif -f -I 23062 pts/0 S 0:00 /sbin/dhcpcd -C -D -K -N -t 999999 -h glum -c /etc/sysconfig/network/scripts/dhcpcd-hook wlan0 23139 ? Ss 0:00 /sbin/dhcpcd -C -R -G -N -Y -t 999999 -h glum -c /etc/sysconfig/network/scripts/dhcpcd-hook eth0 glum:~ # grep -H "" /var/run/sysconfig/if* /var/run/sysconfig/if-eth0:link=yes /var/run/sysconfig/if-eth0:config=eth-id-00:0f:1f:a4:17:f6 /var/run/sysconfig/if-eth0:hwdesc=eth0 /var/run/sysconfig/if-eth0:status=connected /var/run/sysconfig/if-lo:config=lo /var/run/sysconfig/if-lo:hwdesc=lo /var/run/sysconfig/if-lo:status=connected /var/run/sysconfig/if-wlan0:link=yes /var/run/sysconfig/if-wlan0:config=wlan0 /var/run/sysconfig/if-wlan0:hwdesc=wlan0 /var/run/sysconfig/if-wlan0:status=connecting /var/run/sysconfig/ifup-eth0:up=yes /var/run/sysconfig/ifup-lo:up=yes /var/run/sysconfig/ifup-wlan0:up=yes glum:~ # ip a; ip r 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: wlan0: <BROADCAST,MULTICAST,NOTRAILERS,UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:90:4b:73:11:62 brd ff:ff:ff:ff:ff:ff inet6 fe80::290:4bff:fe73:1162/64 scope link valid_lft forever preferred_lft forever 3: eth0: <BROADCAST,MULTICAST,NOTRAILERS,UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:0f:1f:a4:17:f6 brd ff:ff:ff:ff:ff:ff inet 10.20.1.60/20 brd 10.20.15.255 scope global eth0 inet6 fe80::20f:1fff:fea4:17f6/64 scope link valid_lft forever preferred_lft forever 4: sit0: <NOARP> mtu 1480 qdisc noop link/sit 0.0.0.0 brd 0.0.0.0 10.20.0.0/20 dev eth0 proto kernel scope link src 10.20.1.60 169.254.0.0/16 dev eth0 scope link 127.0.0.0/8 dev lo scope link glum:~ # ls /etc/resolv* /etc/resolv.conf glum:~ #
Created attachment 55048 [details] /var/log/messages (2nd test) This is /var/log/messages contents: logger YYY1 rcnetwork restart # run the above commands logger YYY2 unplug logger YYY3 replug cable logger YYY4
BTW is it right that dhcpcd on eth0 runs with "-R -G -Y" (comment #12)? That would suggest why /etc/resolv.conf is empty.
OK, I see your explanation in comment #12. I'll try to get another netcard and let you know, if I managed that. Maybe you could connect to irc (#mobile), I'll be there too.
Sorry, I have no good idea as well. Maybe it suspend/resume related somehow?
It's IMHO not, seems to happen after reboot as well.
Got it. You have a comment "# IFPLUGD_PRIORITY=0" that triggers the bug. I'll apply a simple patch. Nice that it's no race condition this time. ;)
Created attachment 55090 [details] patch in get_priority Please apply it to /etc/sysconfig/network/scripts/functions
Today I came to work again, resumed with cable attached (and no wlan), got proper IP and resolv.conf is finally OK too. So I suppose this is fixed, thanks!
Just to be sure: - with that patch? (And without removing this comment from ifcfg-eth-*) - just one dhcpcd running?
Yeah, with that patch and only one dhcpcd is running (eth0).
Nice. This report helped to fix two bugs and made me aware of a problem in a SP3 sysconfig fix that i added last week. Fixed in svn. Do you think this should become a YOUpdate?
As ifplugd is not used by default yet, I don't think it's necessary to do YOUpdate. However, if you'd do an update anyways, I'd include this.
If i create an YOUpdate, i will check all patches since 10.0. There are more such maybe candidates.
Reading single variables from config files still went wrong if there multiple occurences of such a variable. I fixed that in svn in patchset 1313. I will now add this to the (still) pending YOUpdate as well.