]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.device.xml
Reindent man pages to 2ch
[thirdparty/systemd.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 Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
20
21 You should have received a copy of the GNU Lesser 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>Device unit configuration</refpurpose>
48 </refnamediv>
49
50 <refsynopsisdiv>
51 <para><filename><replaceable>device</replaceable>.device</filename></para>
52 </refsynopsisdiv>
53
54 <refsect1>
55 <title>Description</title>
56
57 <para>A unit configuration file whose name ends in
58 <literal>.device</literal> encodes information about a device unit
59 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 files. The common
66 configuration items are configured in the generic
67 <literal>[Unit]</literal> and <literal>[Install]</literal>
68 sections. A separate <literal>[Device]</literal> section does not
69 exist, since no device-specific options may be configured.</para>
70
71 <para>systemd will dynamically create device units for all kernel
72 devices that are marked with the "systemd" udev tag (by default
73 all block and network devices, and a few others). This may be used
74 to define dependencies between devices and other units. To tag a
75 udev device, use <literal>TAG+="systemd"</literal> in the udev
76 rules file, see
77 <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>
78 for details.</para>
79
80 <para>Device units are named after the <filename>/sys</filename>
81 and <filename>/dev</filename> paths they control. Example: the
82 device <filename noindex='true'>/dev/sda5</filename> is exposed in
83 systemd as <filename>dev-sda5.device</filename>. For details about
84 the escaping logic used to convert a file system path to a unit
85 name see
86 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
87
88 </refsect1>
89
90 <refsect1>
91 <title>The udev Database</title>
92
93 <para>The settings of device units may either be configured via
94 unit files, or directly from the udev database (which is
95 recommended). The following udev device properties are understood
96 by systemd:</para>
97
98 <variablelist class='udev-directives'>
99 <varlistentry>
100 <term><varname>SYSTEMD_WANTS=</varname></term>
101 <term><varname>SYSTEMD_USER_WANTS=</varname></term>
102 <listitem><para>Adds dependencies of type
103 <varname>Wants</varname> from the device unit to all listed
104 units. The first form is used by the system systemd instance,
105 the second by user systemd instances. Those settings may be
106 used to activate arbitrary units when a specific device
107 becomes available.</para>
108
109 <para>Note that this and the other tags are not taken into
110 account unless the device is tagged with the
111 <literal>systemd</literal> string in the udev database,
112 because otherwise the device is not exposed as a systemd unit
113 (see above).</para>
114
115 <para>Note that systemd will only act on
116 <varname>Wants</varname> dependencies when a device first
117 becomes active. It will not act on them if they are added to
118 devices that are already active. Use
119 <varname>SYSTEMD_READY=</varname> (see below) to influence on
120 which udev event to trigger the dependencies.
121 </para></listitem>
122 </varlistentry>
123
124 <varlistentry>
125 <term><varname>SYSTEMD_ALIAS=</varname></term>
126 <listitem><para>Adds an additional alias name to the device
127 unit. This must be an absolute path that is automatically
128 transformed into a unit name. (See above.)</para></listitem>
129 </varlistentry>
130
131 <varlistentry>
132 <term><varname>SYSTEMD_READY=</varname></term>
133 <listitem><para>If set to 0, systemd will consider this device
134 unplugged even if it shows up in the udev tree. If this
135 property is unset or set to 1, the device will be considered
136 plugged if it is visible in the udev tree. This property has
137 no influence on the behavior when a device disappears from the
138 udev tree.</para>
139
140 <para>This option is useful to support devices that initially
141 show up in an uninitialized state in the tree, and for which a
142 <literal>changed</literal> event is generated the moment they
143 are fully set up. Note that <varname>SYSTEMD_WANTS=</varname>
144 (see above) is not acted on as long as
145 <varname>SYSTEMD_READY=0</varname> is set for a
146 device.</para></listitem>
147 </varlistentry>
148
149 <varlistentry>
150 <term><varname>ID_MODEL_FROM_DATABASE=</varname></term>
151 <term><varname>ID_MODEL=</varname></term>
152
153 <listitem><para>If set, this property is used as description
154 string for the device unit.</para></listitem>
155 </varlistentry>
156
157 </variablelist>
158
159 </refsect1>
160
161 <refsect1>
162 <title>See Also</title>
163 <para>
164 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
165 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
166 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
167 <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
168 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
169 </para>
170 </refsect1>
171
172 </refentry>