Bug 721070

Summary: NetworkManager does not set hostname when DHCP used
Product: [Fedora] Fedora Reporter: mark roth <m.roth>
Component: NetworkManagerAssignee: Dan Williams <dcbw>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 15CC: dcbw, jklimes, rh
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 706094 Environment:
Last Closed: 2011-07-19 03:12:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mark roth 2011-07-13 16:07:14 UTC
+++ This bug was initially created as a clone of Bug #706094 +++

Description of problem:

NetworkManager does not set hostname when DHCP used.

Version-Release number of selected component (if applicable):
Version     : 0.8.9997
Release     : 5.git20110702.fc15

How reproducible:
100%

Steps to Reproduce:
1. Install fedora 15.
2. Ensure /etc/sysconfig/network file has not 'hostname' defined, so have only one line
NETWORKING=yes

Edited the network file, to read:
NETWORKING_IPV6=no
# HOSTNAME=localhost.localdomain
NETWORKING=yes
NTPSERVERARGS=iburst

Actual results:

Did a service network restart

hostname gives localhost.localdomain
Expected results:

Hostname should be imported from DHCP server.
Works in Fedora 14. In messages file we can see the message
'Setting system hostname to...  ... (from address lookup)

Additional info:

From /var/log/messages:
Jul 13 11:51:21 myhost NetworkManager[743]: <info> (eth0): device state change: activated -> disconnected (reason 'user-requested') [100 30 39]
Jul 13 11:51:21 myhost NetworkManager[743]: <info> (eth0): deactivating device (reason: 39).
Jul 13 11:51:21 myhost NetworkManager[743]: <info> (eth0): canceled DHCP transaction, DHCP client pid 1872
<snip - nscd>
Jul 13 11:51:21 myhost NetworkManager[743]: <info> Setting system hostname to 'localhost.localdomain' (from system configuration)
<snip - dbus>
<snip - ntpd>
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) starting connection 'System eth0'
Jul 13 11:51:22 myhost NetworkManager[743]: <info> (eth0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) started...
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) scheduled...
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) complete.
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) starting...
Jul 13 11:51:22 myhost NetworkManager[743]: <info> (eth0): device state change: prepare -> config (reason 'none') [40 50 0]
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) successful.
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) complete.
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) started...
Jul 13 11:51:22 myhost NetworkManager[743]: <info> (eth0): device state change: config -> ip-config (reason 'none') [50 70 0]
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Beginning DHCPv4 transaction (timeout in 45 seconds)
Jul 13 11:51:22 myhost NetworkManager[743]: <info> dhclient started with pid 4061
Jul 13 11:51:22 myhost NetworkManager[743]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
Jul 13 11:51:22 myhost dhclient[4061]: Internet Systems Consortium DHCP Client 4.2.1-P1
Jul 13 11:51:22 myhost dhclient[4061]: Copyright 2004-2011 Internet Systems Consortium.
Jul 13 11:51:22 myhost dhclient[4061]: All rights reserved.
Jul 13 11:51:22 myhost dhclient[4061]: For info, please visit https://www.isc.org/software/dhcp/
Jul 13 11:51:22 myhost dhclient[4061]:
Jul 13 11:51:22 myhost NetworkManager[743]: <info> (eth0): DHCPv4 state changed nbi -> preinit
Jul 13 11:51:22 myhost dhclient[4061]: Listening on LPF/eth0/<MAC elided>
Jul 13 11:51:22 myhost dhclient[4061]: Sending on   LPF/eth0/<MAC elided>
Jul 13 11:51:22 myhost dhclient[4061]: Sending on   Socket/fallback
Jul 13 11:51:23 myhost dhclient[4061]: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Jul 13 11:51:23 myhost dhclient[4061]: DHCPACK from <IP address elided>
Jul 13 11:51:23 myhost NetworkManager[743]: <info> (eth0): DHCPv4 state changed preinit -> reboot
Jul 13 11:51:23 myhost NetworkManager[743]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) scheduled...
Jul 13 11:51:23 myhost NetworkManager[743]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) started...
Jul 13 11:51:23 myhost NetworkManager[743]: <info>   address <IP address elided>
Jul 13 11:51:23 myhost NetworkManager[743]: <info>   prefix 23 (255.255.254.0)
Jul 13 11:51:23 myhost NetworkManager[743]: <info>   gateway <IP address elided>
Jul 13 11:51:23 myhost NetworkManager[743]: <info>   hostname <correct hostname displays here>
Jul 13 11:51:23 myhost NetworkManager[743]: <info>   nameserver <IP address elided>
Jul 13 11:51:23 myhost NetworkManager[743]: <info>   nameserver <IP address elided>
Jul 13 11:51:23 myhost NetworkManager[743]: <info>   nameserver <IP address elided>
Jul 13 11:51:23 myhost NetworkManager[743]: <info>   domain name <domain name elided>
Jul 13 11:51:23 myhost NetworkManager[743]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled...
Jul 13 11:51:23 myhost NetworkManager[743]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) complete.
Jul 13 11:51:23 myhost dhclient[4061]: bound to <IP address elided> -- renewal in 83867 seconds.
Jul 13 11:51:23 myhost NetworkManager[743]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) started...
<snip - nscd>
Jul 13 11:51:24 myhost NetworkManager[743]: <info> (eth0): device state change: ip-config -> activated (reason 'none') [70 100 0]
Jul 13 11:51:24 myhost NetworkManager[743]: <info> Policy set 'System eth0' (eth0) as default for IPv4 routing and DNS.
Jul 13 11:51:24 myhost NetworkManager[743]: <info> Activation (eth0) successful, device activated.
Jul 13 11:51:24 myhost NetworkManager[743]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.

At this point, hostname gives localhost.localdomain.

From the original bug:
--- Additional comment from updates on 2011-06-23 23:55:26 EDT ---

NetworkManager-0.8.9997-4.git20110620.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Apparently, as it moved to 0.8.9997-5, this fix was lost.

Comment 1 Jirka Klimes 2011-07-14 07:01:53 UTC

*** This bug has been marked as a duplicate of bug 719100 ***

Comment 2 mark roth 2011-07-14 12:30:43 UTC
Yes, this is exactly 719100. Perhaps you did not read the comment that a) I could not reopen but 719100, and b) the fix from 719100 was apparently NOT MERGED into the -5 subrelease, and the bug has returned.

       mark

Comment 3 Dan Williams 2011-07-19 03:12:46 UTC
(In reply to comment #2)
> Yes, this is exactly 719100. Perhaps you did not read the comment that a) I
> could not reopen but 719100, and b) the fix from 719100 was apparently NOT
> MERGED into the -5 subrelease, and the bug has returned.
> 
>        mark

This is a dupe of 719100, and it'll be fixed when the fix for that bug rolls out too in an update.

*** This bug has been marked as a duplicate of bug 719100 ***