RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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
Target Upstream Version:
Embargoed:


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.