hostname: Fallback to transient hostname
authorBastien Nocera <hadess@hadess.net>
Wed, 9 Nov 2022 15:17:56 +0000 (16:17 +0100)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 10:11:33 +0000 (15:41 +0530)
commit5b6145d047360d44ef15df511a76d1aa37f79df1
treee4d88dafb35674bbc808d076fa40548fad617858
parente7c18865324ccaeb11fd519cb1b16ccb952e232c
hostname: Fallback to transient hostname

After pretty hostname, and static hostname, also support transient
hostname as a last resort before 'BlueZ X.XX'.

This happens on Fedora's Workstation installation as it calls
"hostnamectl set-hostname" on startup. In Fedora Silverblue, the default
hostname is set as fedora in /etc/os-release.

In both cases, we should fall back to that transient hostname, as bad as
it could be.

Note that the transient hostname needs to be monitored through the
kernel directly, as explained in:
https://www.freedesktop.org/software/systemd/man/org.freedesktop.hostname1.html
plugins/hostname.c