YaST Hostnames changes do not survive reboots

Changes in YaST Hostnames do not survive reboots.

Occassionally fails with:

Internal error. Please report a bug report with logs.
Run save_y2logs to get complete logs.

Caller: /usr/lib64/ruby/gems/3.2.0/gems/cheetah-1.0.0/lib/cheetah.rb:675:in `report_errors'

Details: Execution of "/sbin/netconfig update" failed with status 20 (no error output).

save_y2logs produces a tar.xz file full of directories and files

Do you update your System with:
zypper dup

Post
zypper lr

Better zypper lr -d ??

Better zypper lr -d ??

yes, thank you

Yes.

What does the repo list have to do with this error?


#  | Alias                                | Name                        | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                                            | Service
---+--------------------------------------+-----------------------------+---------+-----------+---------+----------+--------+--------------------------------------------------------------------------------+--------
 2 | https-download.opensuse.org-80ed141b | openSUSE:Factory:Update     | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | https://download.opensuse.org/repositories/openSUSE:/Factory:/Update/standard/ | 
 3 | https-download.opensuse.org-b71c02f1 | openSUSE:Tumbleweed         | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | https://download.opensuse.org/repositories/openSUSE:/Tumbleweed/standard/      | 
 5 | packman                              | packman                     | Yes     | (r ) Yes  | Yes     |   90     | rpm-md | https://ftp.fau.de/packman/suse/openSUSE_Tumbleweed/                           | 
 6 | repo-debug                           | openSUSE-Tumbleweed-Debug   | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/tumbleweed/repo/oss/                        | 
 7 | repo-non-oss                         | openSUSE-Tumbleweed-Non-Oss | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/tumbleweed/repo/non-oss/                          | 
 8 | repo-oss                             | openSUSE-Tumbleweed-Oss     | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/tumbleweed/repo/oss/                              | 
 9 | repo-source                          | openSUSE-Tumbleweed-Source  | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/tumbleweed/repo/oss/                       | 
10 | repo-update                          | openSUSE-Tumbleweed-Update  | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/tumbleweed/                                |

We assume you ask here for several reasons.

  • Maybe others have the same problem and can point you right away to a solution or a bug report (but of course you searched the forums and did not find any reference to the same problem, did you?)
  • You want to profit from the error searching, debug experience, etc. of the members here so one or more paths can be walked that may lead to a solution.

In the second case, you should not be surprised when people ask you for information on a path that you did not walk until now. Maybe it leads nowhere, but you never know. People often simply want to get used to the way your system is organized to get a feeling on where things may go wrong.

1 Like

How in particular do you try to set the hostname in yast?
If you insist on yast you should set it under System > Network Settings > Hostname/DNS

and

But the normal way under linux is to use

hostnamectl set-hostname <desired-hostname>
1 Like
  • Start YaST
  • enter root password when prompted
  • Click Hostnames
  • Click Add
  • Enter details
  • Click OK
  • Click OK again to close Hostnames window

Read the provided informations where to set the hostname properly. It is under System > Network Settings > Hostname/DNS

No.

The button is “Hostnames” and it is in YaST > Network Services > Hostnames

Also, the content of /etc/hosts is different than what appears in YaST Hostnames which doesn’t make sense. Something is broken.

No it is not. You need to understand the differences between the two menus. I provided you the links with the relevant informations. The rest is up to you. The last time: YAST > System > Network Settings > Hostname/DNS is the right place to set a permanent hostname which will be reflected in /etc/HOSTNAME

YaST > Network Services > Hostnames is connected to /etc/hosts which is per definition:

This file describes a number of hostname-to-address
mappings for the TCP/IP subsystem. It is mostly
used at boot time, when no name servers are running.
On small systems, this file can be used instead of a
“named” name server

YAST > System > Network Settings > Hostname/DNS is connected to /etc/HOSTNAME which defines the permanent systemwide hostname.

1 Like

Do you even understand what I am trying to do?

Please don’t clutter the conversation if you are not knowledgeable int the subject.

This is related to /etc/hosts NOT /etc/hostname

OP was clear since #1 they are talking about YaST Hostnames, then again in #8 they clarified the procedure in use.

The occasional failure you see could happen from mismatched repositories, that’s why you were asked to provide. Or it can also be a defect.

Regarding /etc/hosts, maybe it’s a symlink to a tmpfs? Post

$ stat /etc/hosts
$ cat /etc/fstab

If it’s a plain file, could you edit this file in the terminal and see if it works?

$ sudo nano /etc/hosts

Perhaps a more plausible issue lies in nsswitch:

$ grep hosts /etc/nsswitch.conf
# Valid databases are: aliases, ethers, group, gshadow, hosts,
hosts:          files resolve dns

What exactly does it mean? Show complete commands and their output you used to determine that.

Is your change present in /etc/hosts after YaST Hostnames completes? Is your change present in /etc/hosts after reboot? Show complete commands and their output you used to check this.

Presumably your understanding of the issue needs to be revised. Nothing is broken on host erlangen:

  • Hostnames survived all boots so far
  • yast2 lan readily switches hostname

Section from journal:

erlangen:~ # journalctl -b -u NetworkManager.service --since 4:30
Mar 27 04:36:29 erlangen1 systemd[1]: Reloading Network Manager...
Mar 27 04:36:29 erlangen1 NetworkManager[1007]: <info>  [1679884589.6600] audit: op="reload" arg="0" pid=7747 uid=0 result="success"
Mar 27 04:36:29 erlangen1 NetworkManager[1007]: <info>  [1679884589.6602] config: No config file found or given; using /etc/NetworkManager/NetworkManager.conf
Mar 27 04:36:29 erlangen1 NetworkManager[1007]: <info>  [1679884589.6602] config: signal: SIGHUP (no changes from disk)
Mar 27 04:36:29 erlangen1 NetworkManager[1007]: <info>  [1679884589.7388] policy: set-hostname: set hostname to 'erlangen' (from system configuration)
Mar 27 04:36:29 erlangen1 systemd[1]: Reloaded Network Manager.
Mar 27 04:36:29 erlangen1 NetworkManager[1007]: <info>  [1679884589.8352] hostname: static hostname changed from "erlangen" to "erlangen1"
Mar 27 04:37:01 erlangen systemd[1]: Reloading Network Manager...
Mar 27 04:37:01 erlangen NetworkManager[1007]: <info>  [1679884621.3282] audit: op="reload" arg="0" pid=9520 uid=0 result="success"
Mar 27 04:37:01 erlangen NetworkManager[1007]: <info>  [1679884621.3283] config: No config file found or given; using /etc/NetworkManager/NetworkManager.conf
Mar 27 04:37:01 erlangen NetworkManager[1007]: <info>  [1679884621.3284] config: signal: SIGHUP (no changes from disk)
Mar 27 04:37:01 erlangen NetworkManager[1007]: <info>  [1679884621.4079] policy: set-hostname: set hostname to 'erlangen1' (from system configuration)
Mar 27 04:37:01 erlangen systemd[1]: Reloaded Network Manager.
Mar 27 04:37:01 erlangen NetworkManager[1007]: <info>  [1679884621.4994] hostname: static hostname changed from "erlangen1" to "erlangen"
erlangen:~ # 

Nobody is saying that there is a problem with the infamous host erlangen. So please leave it out of the discussion and only post when you can contribute something to solving the OPs problem.

Indeed; when I edited /etc/hosts directly in my prior testing, the changes appear to stay and work as expected.

However, the entries are not shown in the YaST control panel.