Renaming hostname only works when system is running

After installing openSUSE RC1 KDE4 on my desktop. I renamed the hostname using Yast–>Network Devices–>Network Settings–>Hostname/DNS tab -->Hostname field to “opensuse-rc1” (without the quotes).
Yast was to save the changes. I logged out and logged in the hostname did NOT change. The machine name assigned to the network card appeared at my prompt, Yast title bar and the application launcher window.

I ran the Online Updater. After which, renaming the hostname worked. Logging out and logging in showed the new hostname. However, if I shutdown and reboot the computer, the machine name assigned to the network card reappeared again. My renamed hostname was lost.

I have created a bug report. Feel free to add to it. https://bugzilla.novell.com/show_bug.cgi?id=772480

Is any one else experiencing the same thing?

I have installed RC1 on three systems. On each, I changed the hostname. On each, it took.

I do always check the box “Assign hostname to loopback IP” and I make sure that “Change hostname via DHCP” is unchecked.

I thought it was recommended not to assign your local a hostname. In all version of openSUSE 10 - 12.1, all I had to do was assign a new name in the hostname field.
I didn’t have to uncheck anything. After looking at my y2log. It appears that Yast is trying to write to /etc/modprobe.d/50-yast.conf.

There is no file called 50-yast.conf. Interesting…

I’m sure there’s a bug in Yast.

It actually assigns the name to 127.0.0.2 rather than 127.0.0.1

I use “sendmail” (instead of “postfix”), and sendmail complains if it is unable to fully qualify the local hostname. That entry in “/etc/hosts” solves that problem.

An additional comment. When I assign a hostname, that name is written to “/etc/HOSTNAME”. You might check whether that file was updated on your system.

I see. You have a different set up. So it makes a lot of sense.

Here’s where I found the bug. The hostname is opensuse-rc1


2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] NetworkInterfaces.ycp:722 No changes to  devices -> nothing to write
2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] NetworkConfig.ycp:160 Writing configuration
2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] NetworkConfig.ycp:162 No changes to NetworkConfig -> nothing to write
2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] Routing.ycp:163 Writing configuration
2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] Routing.ycp:165 No changes to routing -> nothing to write
2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] DNS.ycp:259 Writing configuration
2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] DNS.ycp:265 nameservers=]
2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] DNS.ycp:266 searchlist=]
2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] DNS.ycp:267 hostname=opensuse-rc1
2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] DNS.ycp:268 domain=
2012-07-30 16:19:18 <1> CPE00221595340e-CM000e5cdd65d4(2395) [YCP] DNS.ycp:269 dhcp_hostname=true, write_hostname=false
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] network/runtime.ycp:28 Running SuSEconfig ...
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] Host.ycp:111 Writing hosts configuration
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] Host.ycp:120 Hosts not modified
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] NetworkService.ycp:66 Enabling service network
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] SuSEFirewall4Network.ycp:42 Writing the firewall configuration
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] SuSEFirewall.ycp:3326 Some ServicesAcceptRelated are defined
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] SuSEFirewall.ycp:2533 Firewall settings weren't modified, skipping...
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] SuSEFirewall.ycp:2554 Firewall enable/disable wasn't modified, skipping...
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] SuSEFirewall.ycp:1379 Checking firewall status...
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] SuSEFirewall.ycp:1383 Firewall services are started
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] SuSEFirewall.ycp:2431 Some RPC service found: false
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] SuSEFirewall.ycp:2465 Configuration hasn't modified, skipping restarting services
2012-07-30 16:19:18 <5> opensuse-rc1(2395) [YCP] Lan.ycp:498 virt_net_proposal nil
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] Service.ycp:469 Reloading service network
2012-07-30 16:19:18 <1> opensuse-rc1(2395) [YCP] Service.ycp:299 Running service initscript network reload
2012-07-30 16:19:19 <1> opensuse-rc1(2395) [YCP] network/runtime.ycp:28 Running SuSEconfig ...
2012-07-30 16:19:19 <1> opensuse-rc1(2395) [YCP] NetworkService.ycp:138 Network is running ...
2012-07-30 16:19:19 <1> opensuse-rc1(2395) [YCP] clients/lan.ycp:152 Lan module finished
2012-07-30 16:19:19 <1> opensuse-rc1(2395) [YCP] clients/lan.ycp:153 ----------------------------------------
2012-07-30 16:19:19 <1> opensuse-rc1(2395) [wfm] WFMSubAgent.cc(~WFMSubAgent):41 Deleting SubAgent: 0 scr
2012-07-30 16:19:19 <3> opensuse-rc1(2395) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-30 16:19:19 <1> opensuse-rc1(2395) [agent-modules] ModulesConf.cc(writeFile):560 Modules not modified, not writing
2012-07-30 16:19:19 <3> opensuse-rc1(2395) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-30 16:19:19 <3> opensuse-rc1(2395) [agent-modules] ModulesConf.cc(~ModulesConf):103 Can't write configuration file in destructor.
2012-07-30 16:19:19 <1> opensuse-rc1(2395) [liby2] Y2ProgramComponent.cc(result):159 Sending result: `result (nil)
2012-07-30 16:19:19 &lt;1&gt; opensuse-rc1(2395) [liby2] genericfrontend.cc(main):784 Finished YaST2 component 'y2base'
2012-07-30 16:19:19 &lt;1&gt; opensuse-rc1(2395) [liby2] genericfrontend.cc(main):789 Exiting with client return value 'nil'
2012-07-30 16:19:19 &lt;1&gt; opensuse-rc1(2395) [Y2Perl] YPerl.cc(destroy):164 Shutting down embedded Perl interpreter.

You can see where Yast is trying to create a file in /etc/modprobe.d/50-yast.conf. The it says "Cant write configuration file in destructor.

I see similar lines in y2log. After grepping for “50-yast.conf”, I get:


2012-07-12 19:15:36 <3> linux(2464) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:15:36 <3> linux(2464) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:15:38 <3> linux(2464) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:15:55 <3> linux(2464) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:15:55 <3> linux(2464) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:16:06 <3> linux-9esv(2464) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:16:06 <3> linux-9esv(2464) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:16:35 <3> linux-9esv(2464) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:16:35 <3> linux-9esv(2464) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:20:39 <3> dhcppc255(11646) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:20:39 <3> dhcppc255(11646) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:21:14 <3> dhcppc255(11646) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:21:14 <3> dhcppc255(11646) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:21:47 <3> nwr2(11646) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory
2012-07-12 19:21:47 <3> nwr2(11646) [agent-modules] ModulesConf.cc(getTimeStamp):282 Failed to stat /etc/modprobe.d/50-yast.conf: No such file or directory

I’m not quite sure what is happening there. The first few lines are presumably before automatic configuration of the hostname. The next few show a hostname of “linux-9esv”, which is probably the randomly generated default set during the final stage of install. Then some lines show a hostname of “dhcppc255”. That seems to come from my router, via DHCP, though I am not aware of how to set that in the router. And the last few have a hostname of “nwr2” which is what I set.

Those logs are for a desktop system with ethernet card. I guess I should also check laptops with WiFi networking.

In any case “/etc/modprobe.d/50-yast.conf” does not exist here either, and that did not interfere with setting a hostname.