From 4787996e5934418b33e13682cfb70c6c9a831b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Wed, 21 Jun 2023 14:14:00 +0200 Subject: [PATCH] man/hostnamed: document the various hostname sources and their priorities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The way a hostname for the system is chosen has become quite complex with three classes (static, transient, default) of hostnames and multiple options per class, each with their own priorities w.r.t. which hostname will be prefered over which other hostname. Document the different hostname sources in the systemd-hostnamed man page. Signed-off-by: Leonard Göhrs --- man/systemd-hostnamed.service.xml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/man/systemd-hostnamed.service.xml b/man/systemd-hostnamed.service.xml index 0e42f671c236c..4a63539ebd26a 100644 --- a/man/systemd-hostnamed.service.xml +++ b/man/systemd-hostnamed.service.xml @@ -51,7 +51,33 @@ - The static hostname is stored in /etc/hostname, see + The current hostname is set to the first available and valid option from the following list: + + static hostnames: + + The systemd.hostname= kernel parameter. + The /etc/hostname file. + + + transient hostnames: + + May be set and unset via the systemd-hostnamed.service + DBus API, to e.g. configure a hostname via DHCP. + + + default hostnames: + + The hostname= kernel parameter. + The $SYSTEMD_DEFAULT_HOSTNAME environment variable. + The DEFAULT_HOSTNAME= parameter in the + os-release5 file. + A fallback name specified at compile time. + + + + + The static hostname is stored in /etc/hostname or provided via the + systemd.hostname= kernel commandline parameter, see hostname5 for more information. The pretty hostname, chassis type, and icon name are stored in /etc/machine-info, see @@ -76,6 +102,7 @@ machine-info5, hostnamectl1, sethostname2 + os-release5