script /etc/init.d/boot.localnet used to read the hostname value from /etc/hostname file during the boot time and set the hostname variable. In recent version of opensuse that this file is no longer present. So is there an alternative for this file?
Hostname is set by systemd early on startup and it reads it from /etc/hostname or if this file is missing from /etc/HOSTNAME (traditional SUSE location).
Hi Arvidjaar,
I want to change hostname once after installation through running scripts. I used to edit /etc/HOSTNAME with the new name and used to run /etc/init.d/boot.localnet manually to read the latest hostname in /etc/HOSTNAME and set it in the system. Unfortunately without that script I am no longer able to do that. I do not want to restart my system for systemd to pickup. Do you know of the systemd command I can run to read latest hostname from /etc/HOSTNAME? It would be of great help if you can provide me that command.
hostnamectl