[Bug 440810] New: Can't change hostname with the 'hostname' command.
https://bugzilla.novell.com/show_bug.cgi?id=440810 User gfarrell@netspeed.com.au added comment https://bugzilla.novell.com/show_bug.cgi?id=440810#c440809 Summary: Can't change hostname with the 'hostname' command. Product: openSUSE 11.1 Version: Beta 3 Platform: i686 OS/Version: openSUSE 10.3 Status: NEW Severity: Normal Priority: P5 - None Component: YaST2 AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: gfarrell@netspeed.com.au QAContact: jsrain@novell.com Found By: Community User Note: this bug is the same as #440809 (Network), but has been submitted to address the YaST2 element. Problem: hostname 'linux' persists despite attempts to rename it to something else. When trying to change the hostname, it is not changed in all places that rely on definition of the hostname for system purposes. Changing it in YaST Network Services succeeds in changing /etc/HOSTNAME and the 127.0.0.2 entry in /etc/hosts, but not for the first field of the 127.0.0.1 entry, nor for the 'hostname' line in /etc/NetworkManager/nm-system-settings.conf. Changing it with the 'hostname' command results in changes to /etc/HOSTNAME, but not to /etc/hosts or etc/NetworkManager/nm-system-settings.conf. The result is confusion within the system, where attempts to see what hostname is set will produce different results. For example, the 'hostname' command will show what it has been changed to ('MyHost.MyNetwork', say), as will the contents of /etc/HOSTNAME, but starting a console will show the prompt as 'user@linux:~>'. Any changes made are reset by rebooting the machine, whereupon the hostname 'linux' is resurrected. That is, the output of the hostname command is 'linux', even though the contents of /etc/HOSTNAME is still 'MyHost.MyNetwork'. It seems that NetworkManager's use of a hostname in the nm-system-settings.conf file is new, as is the format of the 127.0.0.1 line in /etc/hosts, but these two changes have not been coordinated well. To fix this hostname problem, one of two courses of action could be taken, followed by a third: a. If NetworkManager is to rely on its own config file for the hostname setting, then: (1) the 'hostname' command should be modified to alter the /etc/NetworkManager/nm-system-settings.conf file, as well as the /etc/HOSTNAME file; and (2) YaST Network Settings should save its 'hostname' setting to the /etc/NetworkManager/nm-system-settings.conf file, as well as the first hostname field of the 127.0.0.1 entry in /etc/hosts. *Or* b. NetworkManager could just refer to /etc/HOSTNAME, which exists precisely for the purpose of defining just that! YaST Network Settings would still need to save its 'hostname' setting to the first hostname field of the 127.0.0.1 entry in /etc/hosts. c. In addition to 'a' or 'b' above, maybe the 'hostname' command could also be modified to change the first hostname field of the 127.0.0.1 entry in /etc/hosts. This is for an installation on a hard drive partition from openSUSE-11.1-Beta3-KDE4-LiveCD-i386.iso; network is set up using NetworkManager, not ifup. Detailed notes are in the attachment. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=440810
Andreas Jaeger
https://bugzilla.novell.com/show_bug.cgi?id=440810
User kmachalkova@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=440810#c2
Katarina Machalkova
When trying to change the hostname, it is not changed in all places that rely on definition of the hostname for system purposes. Changing it in YaST Network Services succeeds in changing /etc/HOSTNAME and the 127.0.0.2 entry in /etc/hosts, but not for the first field of the 127.0.0.1 entry,
That is indeed a bug, YaST network configuration module should substitute every instance of the old hostname in /etc/hosts by the new one ...
nor for the 'hostname' line in /etc/NetworkManager/nm-system-settings.conf.
.. but this is intentional. NetworkManager uses its own settings system and YaST will not interfere with it.
b. NetworkManager could just refer to /etc/HOSTNAME, which exists precisely for the purpose of defining just that!
Afaik, NetworkManager already reads system-wide /etc/HOSTNAME, it must be fixed in some of the recent betas
YaST Network Settings would still need to save its 'hostname' setting to the first hostname field of the 127.0.0.1 entry in /etc/hosts.
If you ever happened to see '127.0.0.1 localhost linux.site localhost.localdomain' line in /etc/hosts, it's been added there by NetworkManager. Here I don't know if NM still does it in this form, or if it just uses a real hostname instead of 'linux.site', neverthless, modifying 127.0.0.1 entry was never done by YaST. YaST uses 127.0.0.2 line for remembering hostname, as a workaround for some broken apps :( -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=440810
User gfarrell@netspeed.com.au added comment
https://bugzilla.novell.com/show_bug.cgi?id=440810#c3
--- Comment #3 from Geoff Farrell
Afaik, NetworkManager already reads system-wide /etc/HOSTNAME, it must be fixed in some of the recent betas
Yes, it was fixed in bug #440809 for Beta 5.
If you ever happened to see '127.0.0.1 localhost linux.site localhost.localdomain' line in /etc/hosts, it's been added there by NetworkManager. Here I don't know if NM still does it in this form, or if it just uses a real hostname instead of 'linux.site', neverthless, modifying 127.0.0.1 entry was never done by YaST.
Yes, I can see that happening when I restart network services when NetworkManager is in charge (with Beta 5). However, mixing localhost and hostname in the 127.0.0.1 line doesn't seem logical; but that needs further investigation, which might require a separate bug report in the 'network' category. But, from what I can glean from your supplied information, YaST-> Network Devices-> Network Services is clear of any buggy behaviour in relation to hostname. So as I see it, this bug can be closed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=440810
User gfarrell@netspeed.com.au added comment
https://bugzilla.novell.com/show_bug.cgi?id=440810#c4
--- Comment #4 from Geoff Farrell
YaST-> Network Devices-> Network Services
Sorry, this should have said: YaST-> Network Devices-> Network Settings I have confirmed that, in 'ifup' method, Network Settings changes the hostname in all three files used to record the hostname: 1. /etc/hosts 2. /etc/HOSTNAME 3. /proc/sys/kernel/hostname This firms my opinion that this bug can be closed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=440810
User kmachalkova@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=440810#c5
Katarina Machalkova
participants (1)
-
bugzilla_noreply@novell.com