Bug 402575

Summary: dhclient unable to override settings inside dhclient.conf breaks NetworkManager
Product: [openSUSE] openSUSE 11.0 Reporter: Philipp Wagner <mail>
Component: NetworkAssignee: Tambet Ingo <tambet>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P2 - High CC: casualprogrammer, jolz, lmuelle, madmax, mt, piny
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 11.0   
Whiteboard:
Found By: Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: part of /var/log/messages
/var/log/NetworkManager

Description Philipp Wagner 2008-06-22 15:50:34 UTC
When I try to use the knetworkmanager applet to connect to a wired or wireless network which uses DHCP, the system gets an IP address from the DHCP server, but networkmanager is unable to recognice that and closes the connection again. The important part of /var/log/messages (complete version is attached) is:

Jun 21 16:51:10 ashley dhclient: bound to 192.168.0.30 -- renewal in 1417 seconds.
Jun 21 16:51:47 ashley dhclient: caught deadly SIGTERM

The corresponding NetworkManger log looks like that:

Jun 21 16:51:02 ashley NetworkManager: <info>  dhclient started with pid 29860
Jun 21 16:51:02 ashley NetworkManager: <info>  Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
Jun 21 16:51:47 ashley NetworkManager: <info>  Device 'eth0' DHCP transaction took too long (>45s), stopping it.
Jun 21 16:51:47 ashley NetworkManager: <info>  eth0: canceled DHCP transaction, dhclient pid 29860

I am able to access the internet in the period between the DHCPOFFER and NetworkManager taking the connection down (with the timestamps here: between 16:51:10 and 16:51:47).
This happens both with wired and wireless connections.
I've installed openSUSE 11 by upgrading from 10.3. With that version I had no problem with the network connection whatsoever.
Comment 1 Philipp Wagner 2008-06-22 15:52:01 UTC
Created attachment 223604 [details]
part of /var/log/messages
Comment 2 Philipp Wagner 2008-06-22 15:52:14 UTC
Created attachment 223605 [details]
/var/log/NetworkManager
Comment 3 Philipp Wagner 2008-06-22 16:07:54 UTC
What I forgot to mention: Using 

# ifconfig eth0 up
# dhclient eth0

works without problems, so it seems to be only an issue of communication between  NetworkManager and dhclient
Comment 4 Helmut Schaa 2008-06-24 12:51:02 UTC
Tambet, I guess this is something for you.
Comment 5 Philipp Wagner 2008-06-24 12:52:58 UTC
Problem solved. OpenSUSE 11 includes dhcpcd 3 (which is mentioned in the release notes) and installs a new config file /etc/dhclient.conf.rpmnew, but leaves the old config file in place.
The old config file contains a line like

script "/sbin/dhclient-script";

In the new config file it looks like this:

# Default location of the dhclient-script. Note: Setting
# it in the config, disables the -sf command line option!
#script "/sbin/dhclient-script";

NetworkManager uses the following call when running dhclient:

/sbin/dhclient -d -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/run/dhclient-eth0.lease -cf /etc/dhclient.conf eth0

Now the problem is obvious: the -sf option does nothing and NetworkManger never realizes that any action happens.

Even though this is working for me now, this is clearly a bug (mention it in the release notes and add possibly a check inside NetworkManger). I've heard complaints from many people upgrading from 10.3 to 11 having this same problem (I would guess almost everybody has that problem?)
Comment 6 Federico Mena Quintero 2008-06-24 17:13:59 UTC
Marking as urgent, as not being able to connect to the network is a big deal.
Comment 7 Max vdP 2008-06-26 16:52:21 UTC
I have a simular problem. My iwl4965 in my asus g1s laptop wil not connect through wifi (wired works fine). I tried to do the steps in the tracking down wireless problems. I left my wireless lan unprotected (no wpa, no wep).

I did:
ifconfig wlan0 up
iwconfig wlan0 essid my_essid_here
iwconfig wlan0 
dhcpcd wlan0

and I got a 169.x.x.x adress instead of a 192.168.x.x adress.
I can give logfiles, but they look simular to earlier logfiles in this or other bugreports for iwl4965.

I have a fresh installation of 11.0-GM. I have only the dhclient.conf file. Not the old file. 
I don't understand comment #5. What can I change to make my wifi connection work? 
And is it oke to add to this bugreport or should I make a new bugreport?
What information do you need from me?
Comment 8 Helmut Schaa 2008-06-30 08:13:52 UTC
Max, can you please try if you can get a connection with static IP setup?
If yes, this is the same issue. If no, please open a new bug report.
Comment 9 Tambet Ingo 2008-06-30 12:08:55 UTC
"(I would guess almost everybody has that problem?)"

Everybody who was using 10.3, changed /etc/dhclient.conf and upgraded to 11.0. 

How should we fix it? I don't agree with showing a dialog, it would be a bit better but wouldn't solve the issue. The only possible solution I see is to fix dhclient to override configuration file values with command line arguments (like every other program does). Marius, do you agree with this solution? Or do you have some other suggestions?
Comment 10 Marius Tomaschewski 2008-06-30 14:07:52 UTC
(In reply to comment #5 from Philipp Wagner)
> Problem solved. OpenSUSE 11 includes dhcpcd 3 (which is mentioned in the
> release notes) and installs a new config file /etc/dhclient.conf.rpmnew,

Please note, that the dhcpcd 3.x update mentioned in release notes is a
completely different dhcp client (used by default by ifup / rcnetwork)
and does not have anything to do with the dhclient (dhcp-client package)
that is used by the NetworkManager. It does not touch dhclient.conf.


(In reply to comment #9 from Tambet Ingo)
> "(I would guess almost everybody has that problem?)"
> 
> Everybody who was using 10.3, changed /etc/dhclient.conf and upgraded to 11.0.

Yes, it looks like.

The dhcp-client RPM installs it (on 11.0 as well as before) using
  %config(noreplace) /etc/dhclient.conf
so when the user modifies it, the RPM installs dhclient.conf.rpmnew only.

> How should we fix it? I don't agree with showing a dialog, it would be a bit
> better but wouldn't solve the issue. The only possible solution I see is to fix
> dhclient to override configuration file values with command line arguments
> (like every other program does). Marius, do you agree with this solution?
> Or do you have some other suggestions?

Hmm...
This would be a change of the behavior of the dhclient (that is not really
usual here) but sounds like the best option we have.
Alternatively it would be possible to add a postinstall hook removing the
script option from the (even user modified) config... not good. The third
way would be to use also the -cf option in NetworkManager.

The dhclient(8) manual page is not very exact about the precedence of config
vs. command line:

"[...]
       The names of the network interfaces that  dhclient  should  attempt  to
       configure  may be specified on the command line.  If no interface names
       are specified on the command line dhclient will normally  identify  all
       network  interfaces,  eliminating non-broadcast interfaces if possible,
       and attempt to configure each interface.

       It  is  also  possible  to  specify   interfaces   by   name   in   the
       dhclient.conf(5)  file.   If interfaces are specified in this way, then
       the client will only configure interfaces that are either specified  in
       the  configuration  file  or  on  the command line, and will ignore all
       other interfaces.
[...]"

Hmm... "either specified in the configuration file or on the command line".
fine and which does it use when both is the case? Ignore all, use all?

"[...]
       The DHCP  client  normally  gets  its  configuration  information  from
       /etc/dhclient.conf,        its        lease        database        from
       /var/lib/dhcp/dhclient.leases, stores its process ID in a  file  called
       /var/run/dhclient.pid,  and  configures  the  network  interface  using
       /sbin/dhclient-script To specify different names and/or  locations  for
       these  files,  use  the -cf, -lf, -pf and -sf flags, respectively, fol-
       lowed by the name of the file.   This can be  particularly  useful  if,
       for  example,  /var/lib/dhcp  or /var/run has not yet been mounted when
       the DHCP client is started.
[...]"

OK, "To specify different names [...] use  the -cf, -lf, -pf and -sf flags"
sound clear enough for me to fix it to override the default & config values
with command line options.

I'll take a look on this, but not before next week.
Comment 11 Tambet Ingo 2008-06-30 14:37:19 UTC
"Alternatively it would be possible to add a postinstall hook removing the
script option from the (even user modified) config... not good."

Yeah, especially not good because people who do modify their dhclient.conf usually don't use NM :)

"The third way would be to use also the -cf option in NetworkManager."

That's what we already do, but having the "script" line in configuration makes dhclient ignore the command line argument.
Comment 12 Max vdP 2008-06-30 16:59:45 UTC
(In reply to comment #8 from Helmut Schaa)
> Max, can you please try if you can get a connection with static IP setup?
> If yes, this is the same issue. If no, please open a new bug report.
> 

I think it's a different issue. I tried the commands from the wiki.
http://en.opensuse.org/Tracking_down_wireless_problems

First of all, I did a fresh installation with 11.0. I only kept my /home partition. I have read the comments, maybe this was different, no upgrade. Only a previous 10.3 install on /home.

But also, I thought at first that the iwl4965 driver was not working. But I got through the point of the "iwconfig wlan0" command.

Then networkmanager wouldn't start anymore. But yesterday I tried (for the last time) the command "rcnetwork start". And I had wifi connection.

After that. I tried a reboot. I tried rcnetwork stop / start again. Everything seems to keep working. For my idea I have not changed anything on the network installation. So I can't explain this. For me, its a miracle. But if you have more questions I wil test en send logs if needed. 

P.S. I didn't try the static ip. I can if you need to.
Comment 13 jolz j 2008-07-01 08:04:48 UTC
I've got a similar problem here: 

Some computers have after booting no ip-adress at the login screen: 

From /var/log/messages the IP vanishes as following: 

Jun 30 05:44:43 newsys dhclient: caught deadly SIGTERM
Jun 30 05:44:43 newsys dhclient: could not restore resolv.conf: No such file or directory
Jun 30 05:44:43 newsys dhclient: DHCPRELEASE on eth0 to 172.16.5.121 port 67
Jun 30 05:44:43 newsys dhclient: send_packet: Network is unreachable
Jun 30 05:44:43 newsys dhclient: send_packet: please consult README file regarding broadcast address.

/var/log/NetworkManager says at this second: 

Jun 30 05:44:43 newsys NetworkManager: <info>  Device 'eth0' DHCP transaction took too long (>45s), stopping it.

as root, I do a "rcnetwork restart" and wait ~10 sec. normally, network is up then and the user ca work. 


This happend on various computers with LAN-connection (NO WLAN!!!!) and is only hardly reproducible: only 1 in ~100 boot cycles shows this problem. 

Network card driver list (don't think, it is important) is currently "forcedeth.c" and "r8169" SuSE Version is 10.3

Comment 14 Pi Ny 2008-07-05 10:30:52 UTC
Not shure whether this is relly the same bug:
After a comprehensive update of packages today, the LAN connections didn't work anymore.
This as well is solved by a manual
rcnetwork restart
command.
 
Comment 15 Pi Ny 2008-07-05 13:07:42 UTC
Just checked SW versions:
Unchanged from openSUSE-retail 11.0
   dhcp-client 3.0.6-86.1
   NetworkManager 0.7.0r3685-7.1-x86_64

Updated NetworkManager-kde 0.7r826733-2.1-x86_64 from KDE-Backports
... downgrading recommended?

Comment 16 Pi Ny 2008-07-06 10:48:54 UTC
(In reply to comment #15 from Pi Ny)
> Just checked SW versions:
> Unchanged from openSUSE-retail 11.0
>    dhcp-client 3.0.6-86.1
>    NetworkManager 0.7.0r3685-7.1-x86_64
> 
> Updated NetworkManager-kde 0.7r826733-2.1-x86_64 from KDE-Backports
> ... downgrading recommended?
> 

After downgrade to NetworManager-kde 0.7r826733-2.1-x86_64 from openSUSE-11.0-Updates it first seemed to be fixed. But after a reboot, similar errors occurred - and even a "rcnetwork restart" didn't help.

Strong indication: This is connected with the system security settings.
The NetworkManager connects fine with "easy" system security setting.
If I choose "secure" (what I would prefer), the NetworkManager is not able to connect.
Comment 17 Philipp Wagner 2008-07-06 14:41:58 UTC
Pi Ny: according to your findings, your problem is not related to this bug. Please search the bug database if this bug has already occurred or open a new bug to prevent this one from filling up with unrelated facts.
Comment 18 Tambet Ingo 2008-08-25 09:36:09 UTC
*** Bug 399204 has been marked as a duplicate of this bug. ***
Comment 19 Andreas Jaeger 2008-11-10 20:39:19 UTC
is this solved now - or do you need further information?  If you need further information from the reporter, let's close it as NORESPONSE.
Comment 20 Philipp Wagner 2008-11-10 20:52:57 UTC
Andreas Jaeger: the problem is as mentioned in comment 5. I don't know if dhclient is fixed so that the option -sf overwrites the settings in the dhclient.conf file, as it did before 11.0.

Other comments in this bug seem to report issues unrelated to the original one.
Comment 21 Tambet Ingo 2008-11-17 09:13:12 UTC
This is fixed in 11.1 betas. NM works around the issue that -sf option is ignored by dhclient when the configuration file has a script tag by copying the configuration file to a temporary location and filters out incompatible tags.