Even though in “yast network” → Network Card → Hostname/DNS we ensure that the “Change Hostname via DHCP” checkbox is de-selected. Every time we reboot now, we lose our hostnames, and it seems like no settings in yast can fix the problem. This was not an issue before the infrastructure change. Anyone have any ideas?
Besides unchecking that checkbox, did you set a new hostname value on the NIC?
Do you need the hostname for anything other than the prompt of your shell?
If not, you could hack that pretty easily. Similarly, you could have
your old hostname work with new IPs via an /etc/hosts hack. Still, I do
not know of any reason why setting the hostname would be something lost
during a reboot unless the new infrastructure had some odd tentacles that
forced a change back, which doesn’t make sense to me.
–
Good luck.
If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…
Thanks for your thoughts ab. Yes, this issue only affects our AWS-based SuSE instances, which used to work just fine, until a couple weeks ago when SuSE upgraded their infrastructure. That upgrade replaced a lot of the startup scripts and seem to have broken the part that allowed us to preserve hostnames across reboots. (hostname is import to us as the software running on them expects the “hostname” command to return the configured hostname and not ip-a.b.c.d). I’m hoping someone from SuSE reads these forums. In the meantime I’m looking for the part of the script that is overwriting /etc/HOSTNAME so that I can fix it myself.
I think I found it. The new SuSE AWS infrastructure uses the cloud-init package and there is a new config file associated with it, /etc/cloud/cloud.cfg, with a parameter that must be set:
preserve_hostname: true
I’m not sure if the setting in YaST is completely ignored or if it must be set in conjunction with /etc/cloud/cloud.cfg.