]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
os-release: add the DEFAULT_HOSTNAME= setting
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Feb 2021 14:08:07 +0000 (15:08 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 22 Feb 2021 19:10:55 +0000 (20:10 +0100)
The motivation is that variants of the same distro that share the same compiled
rpm want to customize various aspects of the system, in particular the
hostname. In some sense the default hostname is part of the identity of the
system, so setting it through os-release makes sense. In particular, instead of
setting a default value in /etc/hostname, the appropriate default can be baked
into the image, leaving /etc/hostname for local overrides only.

Why make this a separate field instead of e.g. using NAME from os-release?
NAME is already used for other purposes, and it seems likely that people want
to set those independently.

man/os-release.xml

index 5a0cfd2887c362341a628a44c45f7522235aeabc..a6d333f2780360c9664b0abfa8435e2fc792557f 100644 (file)
         </para></listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>DEFAULT_HOSTNAME=</varname></term>
+
+        <listitem><para>A string specifying the hostname if
+        <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>5</manvolnum></citerefentry> is not
+        present and no other configuration source specifies the hostname. Must be either a single DNS label
+        (a string composed of 7-bit ASCII lower-case characters and no spaces or dots, limited to the format
+        allowed for DNS domain name labels), or a sequence of such labels separated by single dots that forms
+        a valid DNS FQDN. The total length must be at most 64 characters.</para>
+
+        <para>See
+        <citerefentry><refentrytitle>org.freedesktop.hostname1</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+        for a description of how
+        <citerefentry><refentrytitle>systemd-hostnamed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+        determines the fallback hostname.</para></listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>SYSEXT_LEVEL=</varname></term>