Skip to content

Commit addddf5

Browse files
committed
os-release: add the DEFAULT_HOSTNAME= setting
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.
1 parent aa96ef8 commit addddf5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

man/os-release.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,23 @@
317317
</para></listitem>
318318
</varlistentry>
319319

320+
<varlistentry>
321+
<term><varname>DEFAULT_HOSTNAME=</varname></term>
322+
323+
<listitem><para>A string specifying the hostname if
324+
<citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>5</manvolnum></citerefentry> is not
325+
present and no other configuration source specifies the hostname. Must be either a single DNS label
326+
(a string composed of 7-bit ASCII lower-case characters and no spaces or dots, limited to the format
327+
allowed for DNS domain name labels), or a sequence of such labels separated by single dots that forms
328+
a valid DNS FQDN. The total length must be at most 64 characters.</para>
329+
330+
<para>See
331+
<citerefentry><refentrytitle>org.freedesktop.hostname1</refentrytitle><manvolnum>5</manvolnum></citerefentry>
332+
for a description of how
333+
<citerefentry><refentrytitle>systemd-hostnamed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
334+
determines the fallback hostname.</para></listitem>
335+
</varlistentry>
336+
320337
<varlistentry>
321338
<term><varname>SYSEXT_LEVEL=</varname></term>
322339

0 commit comments

Comments
 (0)