Bugzilla – Bug 444967
hostname cannot be changed when the network type is "user managed by NetworkManager"
Last modified: 2021-02-26 20:18:32 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.
reassign to NetworkManager maintainer
(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?
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).
That sounds like a yast issue, then. Nothing to do with NM.
Of course. This is why I reported it as a YaST bug (I hope so). Or haven't I?
(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.
Miso, back to you :O) Or Bubli?
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 ...
Tambet?
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).
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.
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.
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.
As I explained in bug #440809, that script is not needed. Changing /etc/HOSTNAME is enough to get the change everywhere.
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.
> 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
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
> 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
Anyway, this is really fixed for SLES/D 11 an openSUSE Factory. Unfortunately, bugzilla does not allow setting 'Fixed in milestone' flag to Factory :(