Bug 1356188
Summary: | /etc/hostname change no longer takes effect immediately | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Scott Poore <spoore> |
Component: | NetworkManager | Assignee: | Beniamino Galvani <bgalvani> |
Status: | CLOSED NOTABUG | QA Contact: | Desktop QE <desktop-qa-list> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 7.3 | CC: | atragler, bgalvani, lrintel, mleitner, pkis, rkhan, sukulkar, systemd-maint-list, thaller |
Target Milestone: | rc | ||
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: | 2017-07-13 20:25:14 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
Scott Poore
2016-07-13 15:29:34 UTC
From systemd point of view this is a configuration file which tells what hostname should be set during boot. There must be something else that watches it and change the hostname in kernel and my suspect is Network Manager: [root@old ~]# hostname old [root@old ~]# echo myold > /etc/hostname [root@old ~]# hostname old [root@old ~]# systemctl start NetworkManager [root@old ~]# hostname myold [root@old ~]# echo old > /etc/hostname [root@old ~]# hostname old čec 14 08:33:36 old NetworkManager[955]: <info> Setting system hostname to 'myold' (from system configuration) čec 14 08:33:47 old NetworkManager[955]: <info> Setting system hostname to 'old' (from system configuration) čec 14 08:33:57 old NetworkManager[955]: <info> Setting system hostname to 'myold' (from system configuration) čec 14 08:34:09 old NetworkManager[955]: <info> Setting system hostname to 'old' (from system configuration) čec 14 08:35:07 old NetworkManager[955]: <info> Setting system hostname to 'myold' (from system configuration) čec 14 08:35:16 old NetworkManager[955]: <info> Setting system hostname to 'old' (from system configuration) čec 14 08:50:12 myold NetworkManager[955]: <info> Setting system hostname to 'myold' (from system configuration) čec 14 08:50:13 myold NetworkManager[955]: <info> Setting system hostname to 'old' (from system configuration) FYI, from the hosts I'm testing on, I see these versions: -------------- rhel7.3 --------------------- NetworkManager-1.4.0-0.3.git20160621.072358da.el7.x86_64 -------------- rhel7.2 --------------------- NetworkManager-1.0.6-27.el7.x86_64 I do see NetworkManager running on both. AFAIK all the RHEL documentation suggests to use hostnamectl or nmcli/nmtui to change the system hostname, and writing /etc/hostname directly to do so only worked in RHEL 7.2 because we used to monitor changes to the file to detect when hostnamectl updated the hostname; but in this way we also caught manual changes to the file. Now we monitor hostnamectl properties on D-Bus to detect a change of the hostname and thus writing the file doesn't have effect on the system hostname. In my opinion this is correct as a change to the file should not reconfigure automatically the system. It's also consistent with hostnamed/hostnamectl (which doesn't pick up changes to the file). All changes should go through either hostnamed or nmcli/nmtui. Ok, that explains the change in behavior. Should this be documented somewhere in 7.3 release notes or one of the guides? Thanks, Scott *** Bug 1359222 has been marked as a duplicate of this bug. *** This was documented in RHEL 7.3 Release Notes: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/7.3_Release_Notes/new_features_networking.html and in the Networking Guide. |