Bug 444967

Summary: hostname cannot be changed when the network type is "user managed by NetworkManager"
Product: [openSUSE] openSUSE 11.1 Reporter: Zsolt Sági <novell.admin>
Component: YaST2Assignee: Katarina Machalkova <kmachalkova>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: gfarrell, jdd, michael.monreal, vuntz
Version: Beta 5   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Zsolt Sági 2008-11-14 08:57:24 UTC
I have to change to the ifup managed mode in order to be able to change the hostname. Why? But then, interestingly, after changing back to NetworkManager mode, openSUSE remembers the hostname, set in ifup mode. This may be very confusing and annoying for new and/or inexperienced users.
Comment 1 Michal Zugec 2008-11-14 09:05:56 UTC
reassign to NetworkManager maintainer
Comment 2 Vincent Untz 2008-11-14 16:06:31 UTC
(In reply to comment #0 from Tamás Németh)
> I have to change to the ifup managed mode in order to be able to change the
> hostname.

How do you change the hostname?
Comment 3 Zsolt Sági 2008-11-14 16:19:40 UTC
In the "Network settings" module of YaST, on the Hostname/DNS tab. More interestingly I installed openSUSE 11.1 in hungarian, and the character console version of YaST is enrirely in english, while the QT version is mainly in hungarian (except the main categories, which are in english).
Comment 4 Vincent Untz 2008-11-14 16:47:35 UTC
That sounds like a yast issue, then. Nothing to do with NM.
Comment 5 Zsolt Sági 2008-11-16 15:34:11 UTC
Of course. This is why I reported it as a YaST bug (I hope so). Or haven't I?
Comment 6 Vincent Untz 2008-11-16 15:52:09 UTC
(In reply to comment #5 from Tamás Németh)
> Of course. This is why I reported it as a YaST bug (I hope so). Or haven't I?

This was a reply to comment #1.
Comment 7 Jan Kupec 2008-11-18 11:48:05 UTC
Miso, back to you :O) Or Bubli?
Comment 9 Katarina Machalkova 2008-11-18 18:25:16 UTC
Stano, what is the correct policy here? 

I thought no settings at all can be (are allowed to be) edited by YaST if the user has choosen NetworkManager. By 'no settings at all' I mean, of course, a hostname as well. Correct me if I'm wrong ... 
Comment 10 Stanislav Visnovsky 2008-11-19 09:15:00 UTC
Tambet?
Comment 11 Tambet Ingo 2008-11-19 10:14:20 UTC
I'm not sure. The plan was to not use any /etc/sysconfig/network settings with NetworkManager, and so yast behaves correctly. Afterwards, it became obvious NM simply needs to use /etc/HOSTNAME, too much stuff broke without it (since programs started before networking need hostname too).

I think the best solution is to add UI to NetworkManager's configuration utility to change hostname, but it's too late for 11.1. In reality, it's probably not such a big deal - how often do you really need to change your host name after installation is done and it's still possible (the simplest way is to just edit /etc/HOSTNAME directly).
Comment 12 Katarina Machalkova 2008-11-19 11:11:19 UTC
If it's too late to provide related GUI in NetworkManager for 11.1, then we'd probably better enable editing hostname in YaST, even if NetworkManager is in charge of controlling the network.

Inexperienced user doesn't necessarily have to know that /etc/HOSTNAME file actually holds the desired data.
Comment 13 Geoff Farrell 2008-11-22 04:29:01 UTC
In bug #440809 I have proposed a simple script to change the hostname from the command line. If you think that a Release Note explaining how to use it would be acceptable, then it might save having to re-write YaST before 11.1 release. Tambet makes a good point: the number of users needing to change their hostname after installation is probably quite low. Maybe the 'change-hostname' script, along with a Release Note, might be enough. Later, when NetworkManager can change the hostname with its own UI, then the script would not be needed.
Comment 14 Geoff Farrell 2008-11-22 04:38:40 UTC
The only drawback to the 'change-hostname' method, is that the changes are made to the files manually, with no other configuration taking place. To ensure reliable operation, the computer might need to be re-booted, or instead the X-server and network service might need to be re-started, or maybe some other 'sysconfig' operation that the network experts might know about.
Comment 15 Tambet Ingo 2008-11-24 08:20:54 UTC
As I explained in bug #440809, that script is not needed. Changing /etc/HOSTNAME is enough to get the change everywhere.
Comment 16 Michael Monreal 2008-11-27 17:56:31 UTC
At least in automatic configuration mode, there's no way to set the initial hostname during installation so the hostname ends up as "linux-$random" which looks stupid IMHO. Even more so because this name is exposed on every login (in GDM).

Editing /etc/HOSTNAME is a nice workaround for now but no solution for a longer period of time.
Comment 17 Katarina Machalkova 2008-12-02 16:57:58 UTC
> Editing /etc/HOSTNAME is a nice workaround for now but no solution for a longer
> period of time.

Indeed. As mentioned in comment #11, this should handled by NetworkManager and it hopefully will be in openSUSE 11.2. For the time being, the workaround was added to YaST (where it was a question of un-disabling four widgets).

So just ignore the evil "Network is currently controlled by ..." pop-up and set the hostname in YaST's Network Settings module. 

This will be yast2-network 2.17.61 

Comment 18 Jean-Daniel Dodin 2008-12-25 09:02:18 UTC
In final 11.1!

Changing /etc/hostname or /etc/HOSTNAME *do not* change the hostname!! may be it's in an other file. and the hostname command don't works!

I had also to change network manager to ifup (and have stupidly smppd added when I have no modem) to be able to change the hostname, and after that back again to network manager.

not very user friendly - and my computer always have the same name. down there, linux-qfu4 was the random name and mecum the correct hostname (done after the change):

grep -R linux-qfu4 /etc
/etc/hosts.YaST2save:127.0.0.1  linux-qfu4      localhost.localdomain   localhost
Fichier binaire /etc/aliases.db concorde
/etc/hosts:127.0.0.1    #linux-qfu4     localhost.localdomain   localhost

grep -R mecum /etc
/etc/hosts.YaST2save:127.0.0.2       mecum.perso mecum
/etc/postfix/main.cf:myhostname = mecum.perso
/etc/printcap:hp5m|hp5m:rm=mecum.perso:rp=hp5m:
/etc/printcap:hp_1|hp4100:rm=mecum.perso:rp=hp_1:
/etc/hosts:127.0.0.1       mecum.perso mecum
/etc/hosts:127.0.0.2       mecum.perso mecum
/etc/HOSTNAME:mecum.perso
Comment 19 Katarina Machalkova 2009-01-05 17:06:28 UTC
> Changing /etc/hostname or /etc/HOSTNAME *do not* change the hostname!! may be
> it's in an other file. and the hostname command don't works!

Then please file a separate bug against basesystem (and not YaST, which cannot influence on how 'hostname' command works in any way) and describe how it should work and how it really works instead.

> I had also to change network manager to ifup (and have stupidly smppd added
> when I have no modem) to be able to change the hostname, and after that back
> again to network manager.

I'm sorry, the fix for this bug did not make it into 11.1 final release (which contains y2-network 2.17.60 only - you need to have 2.17.61 to actually see the fix). Hopefully, it'll be available in Factory soon
Comment 20 Katarina Machalkova 2009-01-06 10:04:41 UTC
Anyway, this is really fixed for SLES/D 11 an openSUSE Factory. Unfortunately, bugzilla does not allow setting 'Fixed in milestone' flag to Factory :(