Douglas Schilling Landgraf has uploaded a new change for review. Change subject: network: write new hostname into /etc/hostname ......................................................................
network: write new hostname into /etc/hostname Currently, when users set a new hostname via TUI and reboot the host, it won't save the new hostname. This happens because hostnamectl is not saving the new hostname into /etc/hostname. This patch adds a workaround until we find the root cause. Change-Id: I9bbb7b96f98a70915190846eb7c9d3b22e0af3a1 Signed-off-by: Douglas Schilling Landgraf <[email protected]> --- M src/ovirt/node/config/network.py 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/55/44455/1 diff --git a/src/ovirt/node/config/network.py b/src/ovirt/node/config/network.py index 48779f6..12021a2 100644 --- a/src/ovirt/node/config/network.py +++ b/src/ovirt/node/config/network.py @@ -230,6 +230,15 @@ utils.process.check_call(["hostnamectl", "set-hostname", new_hostname]) + # FIXME: + # hostnamectl --static is not writing into /etc/hostname. + # Because of that, the new hostname won't persist across + # reboot in case user change it via TUI. + # Restarting systemd-hostnamed doesn't help either. + with open('/etc/hostname', 'w+') as f: + if f.read() != new_hostname: + f.write(new_hostname) + return socket.gethostname() -- To view, visit https://gerrit.ovirt.org/44455 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bbb7b96f98a70915190846eb7c9d3b22e0af3a1 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: master Gerrit-Owner: Douglas Schilling Landgraf <[email protected]> _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
