Bug 1359222

Summary: Change of /etc/hostname does not change the hostname
Product: Red Hat Enterprise Linux 7 Reporter: Patrik Kis <pkis>
Component: systemdAssignee: systemd-maint
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: atragler, bgalvani, lrintel, rkhan, systemd-maint-list, thaller
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-26 11:32:11 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:

Description Patrik Kis 2016-07-22 14:25:17 UTC
Description of problem:
For hostname change it is not enough to change /etc/hosts as it was in RHEL-7.2 and earlier releases, but NetworkManager has to be restarted as well. This is a regression.

Version-Release number of selected component (if applicable):
NetworkManager-1.0.6-27.el7

How reproducible:
always

Steps to Reproduce:
1. change /etc.hostname
2. The hostname command return still the old hostname
3.

Actual results:


Expected results:


Additional info:

Comment 2 Patrik Kis 2016-07-26 09:45:17 UTC
Well, this is systemd and not NetworkManager.


# rpm -q systemd
systemd-219-24.el7.x86_64
# cat /etc/hostname
old.host.name
# hostname
old.host.name
# hostnamectl
   Static hostname: old.host.name
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 54a8b1f939e74844af5f5c36eceb7217
           Boot ID: e3d682f65abc438590288405bec7c36f
    Virtualization: kvm
  Operating System: Red Hat Enterprise Linux Server 7.3 Beta (Maipo)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:7.3:beta:server
            Kernel: Linux 3.10.0-470.el7.x86_64
      Architecture: x86-64
# 
# echo new.host.name > /etc/hostname 
# sleep 3
# hostname
old.host.name
# hostnamectl
   Static hostname: new.host.name
Transient hostname: old.host.name
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 54a8b1f939e74844af5f5c36eceb7217
           Boot ID: e3d682f65abc438590288405bec7c36f
    Virtualization: kvm
  Operating System: Red Hat Enterprise Linux Server 7.3 Beta (Maipo)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:7.3:beta:server
            Kernel: Linux 3.10.0-470.el7.x86_64
      Architecture: x86-64
# 



With old systemd it was like this:


# rpm -q systemd
systemd-219-19.el7.x86_64
# cat /etc/hostname
old.host.name
# hostname
old.host.name
# hostnamectl
   Static hostname: old.host.name
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 9c5f29222baa4fb99b755838e1bb5fcb
           Boot ID: 60f88d7784024a8881ae341e3746f6ad
    Virtualization: kvm
  Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:7.2:GA:server
            Kernel: Linux 3.10.0-327.el7.x86_64
      Architecture: x86-64
# 
# echo new.host.name > /etc/hostname 
# sleep 3
# hostname
new.host.name
# hostnamectl
   Static hostname: new.host.name
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 9c5f29222baa4fb99b755838e1bb5fcb
           Boot ID: 60f88d7784024a8881ae341e3746f6ad
    Virtualization: kvm
  Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:7.2:GA:server
            Kernel: Linux 3.10.0-327.el7.x86_64
      Architecture: x86-64
#

Comment 3 Lukáš Nykrýn 2016-07-26 11:32:11 UTC
Looks like duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1356188

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