chiark / gitweb /
hostnamed: introduce systemd-hostnamed
[elogind.git] / man / os-release.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5
6 <!--
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 -->
24
25 <refentry id="os-release">
26         <refentryinfo>
27                 <title>os-release</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>os-release</refentrytitle>
42                 <manvolnum>5</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>os-release</refname>
47                 <refpurpose>Operating system identification</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename>/etc/os-release</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>The <filename>/etc/os-release</filename> file
58                 contains operating system identification data.</para>
59
60                 <para>The basic file format of
61                 <filename>os-release</filename> is a
62                 newline-separated list of environment-like
63                 shell-compatible variable assignments. It is possible
64                 to source the configuration from shell scripts,
65                 however, beyond mere variable assignments no shell
66                 features are supported, allowing applications to read
67                 the file without implementing a shell compatible
68                 execution engine.</para>
69
70                 <para><filename>/etc/os-release</filename> contains
71                 data that is defined by the operating system vendor
72                 and should not be changed by the administrator.</para>
73
74                 <para>Depending on the operating system other
75                 configuration files might be checked for OS
76                 identification as well, however only as
77                 fallback.</para>
78         </refsect1>
79
80         <refsect1>
81                 <title>Options</title>
82
83                 <para>The following OS identifications parameters may be set using
84                 <filename>/etc/os-release</filename>:</para>
85
86                 <variablelist>
87
88                         <varlistentry>
89                                 <term><varname>NAME=</varname></term>
90
91                                 <listitem><para>A string identifying
92                                 the operating system, without a
93                                 version string, and not necessarily
94                                 suitable for presentation to the
95                                 user. If not set defaults to
96                                 <literal>Linux</literal>. Example:
97                                 <literal>NAME=Fedora</literal> or
98                                 <literal>NAME="Debian
99                                 GNU/Linux"</literal>.</para></listitem>
100                         </varlistentry>
101
102                         <varlistentry>
103                                 <term><varname>VERSION=</varname></term>
104
105                                 <listitem><para>A string identifying
106                                 the operating system version,
107                                 excluding any name information and
108                                 suitable for presentation to the
109                                 user. Example:
110                                 <literal>VERSION=15</literal> or
111                                 <literal>VERSION="15
112                                 (Rawhide)"</literal>.</para></listitem>
113                         </varlistentry>
114
115                         <varlistentry>
116                                 <term><varname>ID=</varname></term>
117
118                                 <listitem><para>A lower-case string
119                                 identifying the operating system,
120                                 excluding any version information and
121                                 suitable for processing by scripts. If
122                                 not set defaults to
123                                 <literal>linux</literal>. Example:
124                                 <literal>ID=fedora</literal>.</para></listitem>
125                         </varlistentry>
126
127                         <varlistentry>
128                                 <term><varname>VERSION_ID=</varname></term>
129
130                                 <listitem><para>A lower-case string
131                                 (mostly numeric) identifying the
132                                 operating system version, excluding
133                                 any name information and suitable for
134                                 processing by scripts. Example:
135                                 <literal>VERSION_ID=15</literal>.</para></listitem>
136                         </varlistentry>
137
138                         <varlistentry>
139                                 <term><varname>PRETTY_NAME=</varname></term>
140
141                                 <listitem><para>A pretty operating
142                                 system name in a format suitable for
143                                 presentation to the user. May or may
144                                 not contain an OS version of some
145                                 kind, as suitable. If not set defaults
146                                 to <literal>Linux</literal>. Example:
147                                 <literal>PRETTY_NAME=Fedora 15
148                                 (Rawhide)</literal>.</para></listitem>
149                         </varlistentry>
150
151                         <varlistentry>
152                                 <term><varname>ANSI_COLOR=</varname></term>
153
154                                 <listitem><para>A suggested
155                                 presentation color when showing the
156                                 distribution name on the console. This
157                                 should be specified as string suitable
158                                 for inclusion in the ESC [ m
159                                 ANSI/ECMA-48 escape code for setting
160                                 graphical rendition. Example:
161                                 <literal>ANSI_COLOR=0;31</literal> for
162                                 red, or
163                                 <literal>ANSI_COLOR=1;34</literal> for
164                                 light blue.</para></listitem>
165                         </varlistentry>
166                 </variablelist>
167
168                 <para>If you interpreting this file from code or a
169                 shell script, use the ID and VERSION_ID fields. When
170                 looking for an OS identification string for
171                 presentation to the user use the PRETTY_STRING
172                 field.</para>
173
174                 <para>Note that operating system vendors may choose
175                 not to provide version information, for example to
176                 accommodate for rolling releases. In this case VERSION
177                 and VERSION_ID may be unset. Applications should not
178                 rely on these fields to be set.</para>
179         </refsect1>
180
181         <refsect1>
182                 <title>Example</title>
183
184                 <programlisting>NAME=Fedora
185 VERSION="15 (Rawhide)"
186 ID=fedora
187 VERSION_ID=15
188 PRETTY_NAME="Fedora 15 (Rawhide)"
189 ANSI_COLOR=0;34</programlisting>
190         </refsect1>
191
192         <refsect1>
193                   <title>See Also</title>
194                   <para>
195                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
196                           <citerefentry><refentrytitle>lsb_release</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
197                           <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
198                           <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
199                           <citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>5</manvolnum></citerefentry>
200                   </para>
201         </refsect1>
202
203 </refentry>