Bug 719100

Summary: NetworkManager doesn't set hostname to value returned from dhclient
Product: [Fedora] Fedora Reporter: Philip Prindeville <philipp>
Component: NetworkManagerAssignee: Dan Williams <dcbw>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: awilliam, dcbw, jklimes, Marcin.Dulak, m.roth, philipp, rvykydal, sandro
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=719101
Whiteboard: AcceptedNTH
Fixed In Version: NetworkManager-0.9.1.90-4.git20110927.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-24 23:22:32 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 713566    
Attachments:
Description Flags
/var/log/messages
none
dhclient lease file none

Description Philip Prindeville 2011-07-05 14:56:02 EDT
Description of problem:

"network" will set the hostname (in ifup-post) to the value returned by "ipcalc --silent --hostname x.x.x.x", but NetworkManager won't do this.


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

0.8.9997-4.git20110620

How reproducible:


Steps to Reproduce:
1. configure an interface to use dhcp
2. enable the network service, bring that up
3. disable the network service, enable NetworkManager, bring that up
  
Actual results:

hostname is whatever the DNS server returns for that address for 2, it's localhost for 3.

Expected results:

should be the value in 2. in both cases (i.e. whatever it is in the DNS)

Additional info:
Comment 1 Jirka Klimes 2011-07-08 03:36:50 EDT
NetworkManager tries to set hostname in the following order:

1) a configured hostname (from settings)
2) automatic hostname from the default device's config (DHCP, VPN, etc)
3) the original hostname when NM started
4) reverse-DNS lookup

Please grab /var/log/messages file, so we can see the logs.
Comment 2 Philip Prindeville 2011-07-08 12:10:54 EDT
Created attachment 511957 [details]
/var/log/messages
Comment 3 Philip Prindeville 2011-07-08 12:12:20 EDT
Created attachment 511961 [details]
dhclient lease file
Comment 4 Philip Prindeville 2011-07-08 12:13:52 EDT
[philipp@builder log]$ ipcalc --silent --hostname 192.168.1.10HOSTNAME=builder.redfish-solutions.com
[philipp@builder log]$
Comment 5 Jirka Klimes 2011-07-12 09:13:06 EDT
NM didn't get the host name correctly from the DHCP options.

Fixed upstream:
6272052f9dd9a27a2253515f47c8414ed53c09cf (master)
19cb59f5e66709877e7312fc51c4e02ec17de0f8 (NM_0_8)
Comment 6 Jirka Klimes 2011-07-14 03:01:53 EDT
*** Bug 721070 has been marked as a duplicate of this bug. ***
Comment 7 Philip Prindeville 2011-07-17 02:28:47 EDT
(In reply to comment #5)
> NM didn't get the host name correctly from the DHCP options.
> 
> Fixed upstream:
> 6272052f9dd9a27a2253515f47c8414ed53c09cf (master)
> 19cb59f5e66709877e7312fc51c4e02ec17de0f8 (NM_0_8)

When will we be able to download a new version with this fix?
Comment 8 Dan Williams 2011-07-18 23:12:46 EDT
*** Bug 721070 has been marked as a duplicate of this bug. ***
Comment 9 Fedora Update System 2011-07-21 17:21:33 EDT
NetworkManager-0.8.9997-6.git20110721.fc15,NetworkManager-openswan-0.8.999-2.git20110721.fc15,NetworkManager-openvpn-0.8.9997-2.git20110721.fc15,NetworkManager-vpnc-0.8.999-3.git20110721.fc15,NetworkManager-pptp-0.8.999-2.git20110721.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/NetworkManager-0.8.9997-6.git20110721.fc15,NetworkManager-openswan-0.8.999-2.git20110721.fc15,NetworkManager-openvpn-0.8.9997-2.git20110721.fc15,NetworkManager-vpnc-0.8.999-3.git20110721.fc15,NetworkManager-pptp-0.8.999-2.git20110721.fc15
Comment 10 Fedora Update System 2011-07-22 22:03:32 EDT
Package NetworkManager-0.8.9997-6.git20110721.fc15, NetworkManager-openswan-0.8.999-2.git20110721.fc15, NetworkManager-openvpn-0.8.9997-2.git20110721.fc15, NetworkManager-vpnc-0.8.999-3.git20110721.fc15, NetworkManager-pptp-0.8.999-2.git20110721.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing NetworkManager-0.8.9997-6.git20110721.fc15 NetworkManager-openswan-0.8.999-2.git20110721.fc15 NetworkManager-openvpn-0.8.9997-2.git20110721.fc15 NetworkManager-vpnc-0.8.999-3.git20110721.fc15 NetworkManager-pptp-0.8.999-2.git20110721.fc15'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/NetworkManager-0.8.9997-6.git20110721.fc15,NetworkManager-openswan-0.8.999-2.git20110721.fc15,NetworkManager-openvpn-0.8.9997-2.git20110721.fc15,NetworkManager-vpnc-0.8.999-3.git20110721.fc15,NetworkManager-pptp-0.8.999-2.git20110721.fc15
then log in and leave karma (feedback).
Comment 11 Fedora Update System 2011-08-02 22:29:43 EDT
NetworkManager-0.8.9997-6.git20110721.fc15, NetworkManager-openswan-0.8.999-2.git20110721.fc15, NetworkManager-openvpn-0.8.9997-2.git20110721.fc15, NetworkManager-vpnc-0.8.999-3.git20110721.fc15, NetworkManager-pptp-0.8.999-2.git20110721.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 12 Radek Vykydal 2011-10-18 10:16:51 EDT
I think I am hitting this in F16 TC1 - setting hostname from DHCP doesn't work. In F15 it does, for details and logs please follow https://bugzilla.redhat.com/show_bug.cgi?id=733425#c9. Also on installed F16 TC1 with no HOSTNAME in /etc/sysconfig/network, referring to:

   NetworkManager tries to set hostname in the following order:

   1) a configured hostname (from settings)
   2) automatic hostname from the default device's config (DHCP, VPN, etc)
   3) the original hostname when NM started
   4) reverse-DNS lookup

4) works, whereas 2) (DHCP) doesn't

Or is it another issue?
Comment 13 Radek Vykydal 2011-10-20 05:00:06 EDT
Reopening the bug to get info, please see comment #12.
Comment 14 Jirka Klimes 2011-10-20 11:13:41 EDT
Mea culpa!

The changes from comment #5 are wrong.
dhclient puts options to environment with prefix "new_". However, we remove that prefix before inserting options into NMDHCP4Config. So "host_name" was right.

Now fixed upstream:
74615ce23c8db9bbb4404860523feed1c9a5ffc8 (master)
8e564972d6caee688f6f0894ce05863735ab6649 (NM_0_8)

The original problem was probably caused by having HOSTNAME configured in /etc/sysconfig/network file that takes precedence as described in comment #12.
Comment 15 Sandro Mathys 2011-10-20 11:25:01 EDT
Blocking F16Blocker so it will be considered in the next Blocker Bug meeting.

This bug sorta goes hand-in-hand with bug #733425 (which is considered NTH) and has a proposed fix, so I proposed this bug be marked NTH as well.
Comment 16 Radek Vykydal 2011-10-20 11:40:01 EDT
(In reply to comment #15)
> Blocking F16Blocker so it will be considered in the next Blocker Bug meeting.
> 
> This bug sorta goes hand-in-hand with bug #733425 (which is considered NTH) and
> has a proposed fix, so I proposed this bug be marked NTH as well.

+1, you were faster :)
Comment 17 Adam Williamson 2011-10-20 12:39:44 EDT
Jirka, Dan, can you please build an F16 NM with a fix for this? Thanks.
Comment 18 Fedora Update System 2011-10-21 05:00:02 EDT
NetworkManager-0.9.1.90-4.git20110927.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/NetworkManager-0.9.1.90-4.git20110927.fc16
Comment 19 Adam Williamson 2011-10-21 13:19:16 EDT
Discussed at 2011-10-21 blocker review meeting. Doesn't hit any blocker criteria, but is a visible installation bug that can't be fixed post-release, so accepted as NTH.
Comment 20 Fedora Update System 2011-10-21 20:12:09 EDT
Package NetworkManager-0.9.1.90-4.git20110927.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing NetworkManager-0.9.1.90-4.git20110927.fc16'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-14722
then log in and leave karma (feedback).
Comment 21 Fedora Update System 2011-10-24 23:22:32 EDT
NetworkManager-0.9.1.90-4.git20110927.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 22 Philip Prindeville 2011-10-26 15:30:05 EDT
(In reply to comment #21)
> NetworkManager-0.9.1.90-4.git20110927.fc16 has been pushed to the Fedora 16
> stable repository.  If problems still persist, please make note of it in this
> bug report.

Is the f15 version going to be re-released since the original release doesn't seem to have fixed this (at least not according to comment #13 and #14)?
Comment 23 marcindulak 2012-11-14 12:03:20 EST
Still present in Fedora 17 (system is up to date).
The problem reappeared few days ago.
Disabling chkconfig NetworkManager off and enabling chkconfig network on
+ reboot results in correct hostname, but
/var/log/messages still showing localhost
Nov 14 16:41:00 localhost ...
Checking old /var/log/messages* shows localhost has been there for a long time.

/etc/sysconfig/network:
NETWORKING=yes
HOSTNAME=localhost.localdomain
NM_IGNORE_HOSTNAME_LOCALHOST=yes

and /etc/hosts:
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
Comment 24 Philip Prindeville 2012-11-14 16:30:00 EST
(In reply to comment #23)
> Still present in Fedora 17 (system is up to date).
> The problem reappeared few days ago.
> Disabling chkconfig NetworkManager off and enabling chkconfig network on
> + reboot results in correct hostname, but
> /var/log/messages still showing localhost
> Nov 14 16:41:00 localhost ...
> Checking old /var/log/messages* shows localhost has been there for a long
> time.
> 
> /etc/sysconfig/network:
> NETWORKING=yes
> HOSTNAME=localhost.localdomain
> NM_IGNORE_HOSTNAME_LOCALHOST=yes
> 
> and /etc/hosts:
> 127.0.0.1   localhost localhost.localdomain localhost4
> localhost4.localdomain4
> ::1         localhost localhost.localdomain localhost6
> localhost6.localdomain6

Does this still happen if you restart/reload rsyslog? I suspect that rsyslog is starting before the network service has come up.
Comment 25 marcindulak 2012-11-15 03:45:26 EST
You are right, but this syslog problem is just a side bug.
Booting with chkconfig network on (NetworkManager off), and after service syslog restart the correct hostname appears in /var/log/messages.
Comment 26 marcindulak 2012-11-20 12:13:28 EST
Is the bug to be reopen?
Comment 27 marcindulak 2012-11-23 04:36:01 EST
Same fedora 17 bug #875085