Bug 719100 - NetworkManager doesn't set hostname to value returned from dhclient
Summary: NetworkManager doesn't set hostname to value returned from dhclient
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager
Version: 26
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Lubomir Rintel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedNTH
: 721070 (view as bug list)
Depends On:
Blocks: F16-accepted, F16FinalFreezeExcept
TreeView+ depends on / blocked
 
Reported: 2011-07-05 18:56 UTC by Philip Prindeville
Modified: 2017-11-27 08:58 UTC (History)
9 users (show)

Fixed In Version: NetworkManager-0.9.1.90-4.git20110927.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-27 08:58:30 UTC


Attachments (Terms of Use)
/var/log/messages (641.38 KB, text/plain)
2011-07-08 16:10 UTC, Philip Prindeville
no flags Details
dhclient lease file (1.24 KB, text/plain)
2011-07-08 16:12 UTC, Philip Prindeville
no flags Details
Script used as a workaround (319 bytes, text/plain)
2017-10-26 18:39 UTC, Philip Prindeville
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 719101 None None None Never

Internal Links: 719101

Description Philip Prindeville 2011-07-05 18:56:02 UTC
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 07:36:50 UTC
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 16:10:54 UTC
Created attachment 511957 [details]
/var/log/messages

Comment 3 Philip Prindeville 2011-07-08 16:12:20 UTC
Created attachment 511961 [details]
dhclient lease file

Comment 4 Philip Prindeville 2011-07-08 16:13:52 UTC
[philipp@builder log]$ ipcalc --silent --hostname 192.168.1.10HOSTNAME=builder.redfish-solutions.com
[philipp@builder log]$

Comment 5 Jirka Klimes 2011-07-12 13:13:06 UTC
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 07:01:53 UTC
*** Bug 721070 has been marked as a duplicate of this bug. ***

Comment 7 Philip Prindeville 2011-07-17 06:28:47 UTC
(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-19 03:12:46 UTC
*** Bug 721070 has been marked as a duplicate of this bug. ***

Comment 9 Fedora Update System 2011-07-21 21:21:33 UTC
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-23 02:03:32 UTC
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-03 02:29:43 UTC
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 14:16:51 UTC
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 09:00:06 UTC
Reopening the bug to get info, please see comment #12.

Comment 14 Jirka Klimes 2011-10-20 15:13:41 UTC
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 15:25:01 UTC
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 15:40:01 UTC
(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 16:39:44 UTC
Jirka, Dan, can you please build an F16 NM with a fix for this? Thanks.

Comment 18 Fedora Update System 2011-10-21 09:00:02 UTC
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 17:19:16 UTC
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-22 00:12:09 UTC
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-25 03:22:32 UTC
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 19:30:05 UTC
(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 17:03:20 UTC
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 21:30:00 UTC
(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 08:45:26 UTC
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 17:13:28 UTC
Is the bug to be reopen?

Comment 27 marcindulak 2012-11-23 09:36:01 UTC
Same fedora 17 bug #875085

Comment 28 Philip Prindeville 2017-10-26 18:39:48 UTC
Created attachment 1343928 [details]
Script used as a workaround

Comment 29 Thomas Haller 2017-11-27 08:58:30 UTC
Let's not reopen a bug that was closed for 5 years.

If you have a bug with similar symptoms, the cause is very likely different. Especially, because hostname handling was significantly refactored in the past years.

Please open a new bug, and provide all necessary information for debugging. Thanks.


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