Mailinglist Archive: opensuse-bugs (16652 mails)

< Previous Next >
[Bug 440809] New: Can't change hostname with the 'hostname' command
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Fri, 31 Oct 2008 23:35:52 -0600 (MDT)
  • Message-id: <bug-440809-21960@xxxxxxxxxxxxxxxxxxxxxxxxx/>
https://bugzilla.novell.com/show_bug.cgi?id=440809


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: Network
AssignedTo: bnc-team-screening@xxxxxxxxxxxxxxxxxxxxxx
ReportedBy: gfarrell@xxxxxxxxxxxxxxx
QAContact: qa@xxxxxxx
Found By: Community User


Created an attachment (id=249229)
--> (https://bugzilla.novell.com/attachment.cgi?id=249229)
Detailed notes showing the output of various commands re 'hostname'.

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.

< Previous Next >