chiark / gitweb /
build-sys: allow cross-compilation
[elogind.git] / man / systemd.device.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="systemd.device">
26         <refentryinfo>
27                 <title>systemd.device</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>systemd.device</refentrytitle>
42                 <manvolnum>5</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd.device</refname>
47                 <refpurpose>systemd device configuration files</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename>systemd.device</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>A unit configuration file whose name ends in
58                 <filename>.device</filename> encodes information about
59                 a device unit as exposed in the
60                 sysfs/<citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>
61                 device tree.</para>
62
63                 <para>This unit type has no specific options. See
64                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
65                 for the common options of all unit configuration
66                 files. The common configuration items are configured
67                 in the generic <literal>[Unit]</literal> and
68                 <literal>[Install]</literal> sections. A separate
69                 <literal>[Device]</literal> section does not exist,
70                 since no device-specific options may be
71                 configured.</para>
72
73                 <para>systemd will automatically create dynamic device
74                 units for all kernel devices that are marked with the
75                 "systemd" udev tag (by default all block and network
76                 devices, and a few others). This may be used to define
77                 dependencies between devices and other
78                 units.</para>
79
80                 <para>Device units are named after the
81                 <filename>/sys</filename> and
82                 <filename>/dev</filename> paths they control. Example:
83                 the device <filename>/dev/sda5</filename> is exposed
84                 in systemd as <filename>dev-sda5.device</filename>. For
85                 details about the escaping logic used to convert a
86                 file system path to a unit name see
87                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
88
89         </refsect1>
90
91         <refsect1>
92                 <title>The udev Database</title>
93
94                 <para>The settings of device units may either be
95                 configured via unit files, or directly from the udev
96                 database (which is recommended). The following udev
97                 properties are understood by systemd:</para>
98
99                 <variablelist>
100                         <varlistentry>
101                                 <term><varname>SYSTEMD_WANTS=</varname></term>
102                                 <listitem><para>Adds dependencies of
103                                 type <varname>Wants</varname> from
104                                 this unit to all listed units. This
105                                 may be used to activate arbitrary
106                                 units, when a specific device becomes
107                                 available. Note that this and the
108                                 other tags are not taken into account
109                                 unless the device is tagged with the
110                                 "<literal>systemd</literal>" string in
111                                 the udev database, because otherwise
112                                 the device is not exposed as systemd
113                                 unit.</para></listitem>
114                         </varlistentry>
115
116                         <varlistentry>
117                                 <term><varname>SYSTEMD_ALIAS=</varname></term>
118                                 <listitem><para>Adds an additional
119                                 alias name to the device unit. This
120                                 must be an absolute path that is
121                                 automatically transformed into a unit
122                                 name. (See above.)</para></listitem>
123                         </varlistentry>
124
125                         <varlistentry>
126                                 <term><varname>ID_MODEL_FROM_DATABASE=</varname></term>
127                                 <term><varname>ID_MODEL=</varname></term>
128
129                                 <listitem><para>If set, this property is
130                                 used as description string for the
131                                 device unit.</para></listitem>
132                         </varlistentry>
133
134                 </variablelist>
135
136
137         </refsect1>
138
139         <refsect1>
140                   <title>See Also</title>
141                   <para>
142                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
143                           <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
144                           <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
145                           <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>
146                   </para>
147         </refsect1>
148
149 </refentry>