Debian Codegraph @

man/machine-info.xml

raw
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="machine-info" xmlns:xi="http://www.w3.org/2001/XInclude">
7 <refentryinfo>
8 <title>machine-info</title>
9 <productname>systemd</productname>
10 </refentryinfo>
11
12 <refmeta>
13 <refentrytitle>machine-info</refentrytitle>
14 <manvolnum>5</manvolnum>
15 </refmeta>
16
17 <refnamediv>
18 <refname>machine-info</refname>
19 <refpurpose>Local machine information file</refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23 <para><filename>/etc/machine-info</filename></para>
24 </refsynopsisdiv>
25
26 <refsect1>
27 <title>Description</title>
28
29 <para>The <filename>/etc/machine-info</filename> file contains
30 machine metadata.</para>
31
32 <para>The format of <filename>machine-info</filename> is a newline-separated list of environment-like
33 shell-compatible variable assignments, ignoring comments and empty lines. It is possible to source the
34 configuration from shell scripts, however, beyond mere variable assignments no shell features are
35 supported, allowing applications to read the file without implementing a shell compatible execution
36 engine. See
37 <citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry> for a
38 detailed description of the format.</para>
39
40 <para><filename>/etc/machine-info</filename> contains metadata about the machine that is set by the user
41 or administrator. The settings configured here have the highest precedence. When not set, appropriate
42 values may be determined automatically, based on the information about the hardware or other
43 configuration files. It is thus completely fine for this file to not be present.</para>
44
45 <para>You may use
46 <citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
47 to change the settings of this file from the command line.</para>
48 </refsect1>
49
50 <refsect1>
51 <title>Options</title>
52
53 <para>The following machine metadata parameters may be set using
54 <filename>/etc/machine-info</filename>:</para>
55
56 <refsect2>
57 <title>Machine Information</title>
58
59 <variablelist class='environment-variables'>
60
61 <varlistentry>
62 <term><varname>PRETTY_HOSTNAME=</varname></term>
63
64 <listitem><para>A pretty human-readable UTF-8 machine
65 identifier string. This should contain a name like
66 <literal>Lennart's Laptop</literal> which is useful to present
67 to the user and does not suffer by the syntax limitations of
68 internet domain names. If possible, the internet hostname as
69 configured in <filename>/etc/hostname</filename> should be
70 kept similar to this one. Example: if this value is
71 <literal>Lennart's Computer</literal> an Internet hostname of
72 <literal>lennarts-computer</literal> might be a good choice.
73 If this parameter is not set, an application should fall back
74 to the Internet hostname for presentation
75 purposes.</para></listitem>
76 </varlistentry>
77
78 <varlistentry>
79 <term><varname>ICON_NAME=</varname></term>
80
81 <listitem><para>An icon identifying this machine according to
82 the <ulink
83 url="https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html">XDG
84 Icon Naming Specification</ulink>. If this parameter is not
85 set, an application should fall back to
86 <literal>computer</literal> or a similar icon
87 name.</para></listitem>
88 </varlistentry>
89
90 <varlistentry>
91 <term><varname>CHASSIS=</varname></term>
92
93 <listitem><para>The chassis type. Currently, the following
94 chassis types are defined:
95 <literal>desktop</literal>,
96 <literal>laptop</literal>,
97 <literal>convertible</literal>,
98 <literal>server</literal>,
99 <literal>tablet</literal>,
100 <literal>handset</literal>,
101 <literal>watch</literal>, and
102 <literal>embedded</literal>,
103 as well as the special chassis types
104 <literal>vm</literal> and
105 <literal>container</literal> for
106 virtualized systems that lack an immediate physical chassis.</para>
107
108 <para>Note that most systems allow detection of the chassis type automatically (based on firmware
109 information or suchlike). This setting should only be used to override a misdetection or to manually
110 configure the chassis type where automatic detection is not available.</para>
111
112 <xi:include href="version-info.xml" xpointer="v197"/></listitem>
113 </varlistentry>
114
115 <varlistentry>
116 <term><varname>DEPLOYMENT=</varname></term>
117
118 <listitem><para>Describes the system deployment environment.
119 One of the following is suggested:
120 <literal>development</literal>,
121 <literal>integration</literal>,
122 <literal>staging</literal>,
123 <literal>testing</literal>,
124 <literal>production</literal>.
125 </para>
126
127 <xi:include href="version-info.xml" xpointer="v216"/></listitem>
128 </varlistentry>
129
130 <varlistentry>
131 <term><varname>LOCATION=</varname></term>
132
133 <listitem><para>Describes the system location if applicable
134 and known. Takes a human-friendly, free-form string. This may
135 be as generic as <literal>Berlin, Germany</literal> or as
136 specific as <literal>Left Rack, 2nd Shelf</literal>.
137 </para>
138
139 <xi:include href="version-info.xml" xpointer="v216"/></listitem>
140 </varlistentry>
141
142 <varlistentry>
143 <term><varname>TAGS=</varname></term>
144
145 <listitem><para>A colon-separated list of tags attached to this machine. Tags are short labels that
146 may be used to classify and group machines for management purposes, for example to identify the role
147 a machine plays in a deployment (<literal>webserver</literal>, <literal>database</literal>), the
148 fleet or organizational unit it belongs to, or any other administrator-defined attribute. Example:
149 <literal>TAGS=webserver:frontend:berlin</literal>.</para>
150
151 <para>Each individual tag must be 1…255 characters long and may consist only of the ASCII
152 alphanumeric characters, <literal>-</literal> and <literal>.</literal>.</para>
153
154 <para>The configured tags may be matched against with the
155 <varname>ConditionMachineTag=</varname> and <varname>AssertMachineTag=</varname> unit settings, see
156 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
157 for details. They may be queried and changed with the <command>tags</command> command of
158 <citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
159
160 <xi:include href="version-info.xml" xpointer="v261"/></listitem>
161 </varlistentry>
162
163 <varlistentry>
164 <term><varname>HARDWARE_VENDOR=</varname></term>
165
166 <listitem><para>Specifies the hardware vendor. If unspecified, the hardware vendor set in DMI or
167 <citerefentry><refentrytitle>hwdb</refentrytitle><manvolnum>7</manvolnum></citerefentry> will be
168 used.</para>
169
170 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
171 </varlistentry>
172
173 <varlistentry>
174 <term><varname>HARDWARE_MODEL=</varname></term>
175
176 <listitem><para>Specifies the hardware model. If unspecified, the hardware model set in DMI or
177 <citerefentry><refentrytitle>hwdb</refentrytitle><manvolnum>7</manvolnum></citerefentry> will be
178 used.</para>
179
180 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
181 </varlistentry>
182
183 <varlistentry>
184 <term><varname>HARDWARE_SKU=</varname></term>
185
186 <listitem><para>Specifies the hardware SKU (Stock-Keeping Unit). If unspecified, the hardware
187 SKU set in DMI will be used.</para>
188
189 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
190 </varlistentry>
191
192 <varlistentry>
193 <term><varname>HARDWARE_VERSION=</varname></term>
194
195 <listitem><para>Specifies the hardware version. If unspecified, the hardware version set in DMI
196 will be used.</para>
197
198 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
199 </varlistentry>
200 </variablelist>
201 </refsect2>
202 <refsect2>
203 <title>Custom Fields</title>
204
205 <para>Operating system vendors and systemd administrators may extend the file format and introduce new
206 fields. It is highly recommended to prefix new fields with an OS-specific name in order to avoid name
207 clashes. Applications reading this file must ignore unknown fields.</para>
208
209 <para>Example: <literal>_LOCAL_EMERGENCY_CONTACT="[email protected]"</literal>.</para>
210 </refsect2>
211 </refsect1>
212
213 <refsect1>
214 <title>Example</title>
215
216 <programlisting>PRETTY_HOSTNAME="Lennart's Tablet"
217 ICON_NAME=computer-tablet
218 CHASSIS=tablet
219 DEPLOYMENT=production
220 TAGS=demo:berlin</programlisting>
221 </refsect1>
222
223 <refsect1>
224 <title>See Also</title>
225 <para><simplelist type="inline">
226 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
227 <member><citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
228 <member><citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
229 <member><citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
230 <member><citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
231 <member><citerefentry><refentrytitle>systemd-hostnamed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
232 </simplelist></para>
233 </refsect1>
234
235 </refentry>