Bug 129648 - startmode=ifplugd doesn't set resolv.conf
Summary: startmode=ifplugd doesn't set resolv.conf
Status: VERIFIED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Network (show other bugs)
Version: Final
Hardware: Other Other
: P5 - None : Major
Target Milestone: ---
Assignee: Christian Zoz
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-20 07:47 UTC by Michal Svec
Modified: 2007-06-05 09:37 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
let ifdown wait for ifplugd to terminate (1.19 KB, patch)
2005-10-20 10:29 UTC, Christian Zoz
Details | Diff
/var/log/messages (19.75 KB, text/plain)
2005-10-20 14:04 UTC, Michal Svec
Details
/var/log/messages (2nd test) (17.13 KB, text/plain)
2005-10-21 09:17 UTC, Michal Svec
Details
patch in get_priority (456 bytes, patch)
2005-10-21 16:39 UTC, Christian Zoz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Svec 2005-10-20 07:47:27 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"
Comment 1 Christian Zoz 2005-10-20 10:27:51 UTC
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.
Comment 2 Christian Zoz 2005-10-20 10:29:44 UTC
Created attachment 54902 [details]
let ifdown wait for ifplugd to terminate

Michal, please apply this patch to /sbin/ifup and try again.
Comment 3 Michal Svec 2005-10-20 11:15:38 UTC
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:~ #
Comment 4 Michal Svec 2005-10-20 11:17:03 UTC
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
Comment 5 Christian Zoz 2005-10-20 11:41:07 UTC
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*
Comment 6 Michal Svec 2005-10-20 13:24:09 UTC
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:~ # 
Comment 7 Christian Zoz 2005-10-20 13:40:13 UTC
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.
Comment 8 Michal Svec 2005-10-20 14:04:23 UTC
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
Comment 9 Michal Svec 2005-10-20 18:00:19 UTC
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.
Comment 10 Christian Zoz 2005-10-20 18:59:07 UTC
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?
Comment 12 Michal Svec 2005-10-21 09:15:29 UTC
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:~ #
Comment 13 Michal Svec 2005-10-21 09:17:38 UTC
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
Comment 14 Michal Svec 2005-10-21 09:25:15 UTC
BTW is it right that dhcpcd on eth0 runs with "-R -G -Y" (comment #12)?
That would suggest why /etc/resolv.conf is empty.
Comment 15 Michal Svec 2005-10-21 09:34:58 UTC
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.
Comment 16 Joachim Gleissner 2005-10-21 09:36:16 UTC
Sorry, I have no good idea as well. Maybe it suspend/resume related somehow?
Comment 17 Michal Svec 2005-10-21 09:42:28 UTC
It's IMHO not, seems to happen after reboot as well.
Comment 18 Christian Zoz 2005-10-21 16:37:56 UTC
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. ;)
Comment 19 Christian Zoz 2005-10-21 16:39:48 UTC
Created attachment 55090 [details]
patch in get_priority

Please apply it to /etc/sysconfig/network/scripts/functions
Comment 20 Michal Svec 2005-10-24 09:16:05 UTC
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!
Comment 21 Christian Zoz 2005-10-24 10:48:35 UTC
Just to be sure:
- with that patch? (And without removing this comment from ifcfg-eth-*)
- just one dhcpcd running?
Comment 22 Michal Svec 2005-10-24 10:53:02 UTC
Yeah, with that patch and only one dhcpcd is running (eth0).
Comment 23 Christian Zoz 2005-10-24 11:28:07 UTC
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?
Comment 24 Michal Svec 2005-10-24 12:43:27 UTC
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.
Comment 25 Christian Zoz 2005-10-24 14:35:09 UTC
If i create an YOUpdate, i will check all patches since 10.0. There are more such maybe candidates.
Comment 26 Christian Zoz 2006-01-12 15:03:15 UTC
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.