Bug 660128

Summary: NetworkManager ignoring /etc/sysconfig/network hostname, using localhost.localdomain instead
Product: [Fedora] Fedora Reporter: Need Real Name <karlcz>
Component: NetworkManagerAssignee: Dan Williams <dcbw>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: dcbw, pierre-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-25 14:08:25 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Need Real Name 2010-12-05 13:15:37 EST
Description of problem:

We have noticed recently that NetworkManager is ignoring or otherwise overriding /etc/sysconfig/network hostname settings.  We set an FQDN there, but after reboot and logging in via GDM, it has changed to localhost.localdomain.  We are using wireless with DHCP by default, and these are multi-homed laptops.  They are often booted on different networks and/or suspended on one and resumed on another.

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


but we think this has been going on for a while, so it probably isn't specific to that version. It also occurs on an up to date F13 laptop.

How reproducible:

Steps to Reproduce:
1. set a hostname in /etc/sysconfig/network
2. have wireless networks configured in nm-applet with DHCP, shared by all, and on boot
3. reboot
Actual results:

'hostname' returns localhost.localdomain by the time the user logs in

Expected results:

'hostname' ALWAYS returns the value set in /etc/sysconfig/network

Additional info:

I noticed a 'DHCP--Addresses only' option in nm-applet, but that seems to expect manually configured DNS servers.  What we expect is to get the network-provided DNS server IPs, but keep our static hostname no matter what.
Comment 1 Pierre Ossman 2010-12-14 15:47:45 EST
This didn't occur for me on a fully updated F13, but I upgraded to F14 today and got this bug. :/

Dan, comments? Workaround?
Comment 2 Pierre Ossman 2010-12-16 02:25:56 EST
Found the problem here. /etc/hosts had gotten the wrong SELinux context, which upset NM and made it fall back to localhost. I should remember to check the log files before I go complaining in bugzilla next time. :/
Comment 3 Dan Williams 2011-02-25 14:08:25 EST
NM no longer touches /etc/hosts so we shouldn't run into this problem anymore.

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