Bug 882673

Summary: NetworkManager sets hostname despite /etc/hostname existing
Product: [Fedora] Fedora Reporter: Sandro Mani <manisandro>
Component: NetworkManagerAssignee: Dan Williams <dcbw>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: danw, dcbw, jklimes
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 15:38:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
log_nosysconfig
none
log_nosysconfig
none
log_withsysconfig none

Description Sandro Mani 2012-12-02 15:51:33 UTC
Created attachment 656073 [details]
log_nosysconfig

Description of problem:
NetworkManager is setting the transient hostname, despite /etc/hostname existing. If HOSTNAME is defined in /etc/sysconfig/network, however, NetworkManager does not change the hostname, which is the expected behaviour.

Version-Release number of selected component (if applicable):
NetworkManager-0.9.7.0-8.git20121004.fc19.x86_64

How reproducible:
Always

Steps to Reproduce:
- Reboot disconnected from network
- After reboot, before connecting to network

# hostname
PC4

# cat /etc/hostname
PC4

# hostnamectl status
   Static hostname: PC4
   Pretty hostname: PC4
         Icon name: computer-laptop
        Machine ID: 0a582bf873c54f23909d47cc0e47e874
           Boot ID: c562ba9f7781436bb63e70bcf3c9247c
  Operating System: Fedora 19 (Rawhide)
       CPE OS Name: cpe:/o:fedoraproject:fedora:19
            Kernel: Linux 3.7.0-0.rc7.git1.2.fc19.x86_64
      Architecture: x86_64

# cat /etc/sysconfig/network
NETWORKING=yes
NTPSERVERARGS=iburst

- After connecting to network

# hostname
Mani

# cat /etc/hostname 
PC4

# hostnamectl status
   Static hostname: PC4
Transient hostname: Mani
   Pretty hostname: PC4
         Icon name: computer-laptop
        Machine ID: 0a582bf873c54f23909d47cc0e47e874
           Boot ID: 0356f5be6c95427e9e785c4bb5f13290
  Operating System: Fedora 19 (Rawhide)
       CPE OS Name: cpe:/o:fedoraproject:fedora:19
            Kernel: Linux 3.7.0-0.rc7.git2.2.fc19.x86_64
      Architecture: x86_64

# cat /etc/sysconfig/network
NETWORKING=yes
NTPSERVERARGS=iburst

Also see attached log_nosysconfig


Actual results:
NetworkManager changes the transient hostname despite the static hostname being set

Expected results:
NetworkManager should only set the hostname if the static hostname does not exist

Additional info:
As noted above, if I change /etc/sysconfig/network to include the hostname:
# cat /etc/sysconfig/network
NETWORKING=yes
NTPSERVERARGS=iburst
HOSTNAME=PC4

NetworkManager will not set the transient hostname (see attached log_withsysconfig)


By the way, "Mani" is what I set in the field "Router name" in the router configuration.

Comment 1 Sandro Mani 2012-12-02 15:54:55 UTC
Created attachment 656076 [details]
log_nosysconfig

Comment 2 Sandro Mani 2012-12-02 15:55:29 UTC
Created attachment 656087 [details]
log_withsysconfig

Comment 3 Jirka Klimes 2012-12-04 15:38:55 UTC
Fixed upstream, should appear in Fedora soon:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=a7eb3476557dae28880333544c797705ee2f5b5a

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