Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1359222 - Change of /etc/hostname does not change the hostname
Summary: Change of /etc/hostname does not change the hostname
Keywords:
Status: CLOSED DUPLICATE of bug 1356188
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-22 14:25 UTC by Patrik Kis
Modified: 2016-07-26 11:32 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-26 11:32:11 UTC


Attachments (Terms of Use)

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 ***


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