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">
7 This file is part of systemd.
9 Copyright 2010 Lennart Poettering
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.
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.
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/>.
25 <refentry id="systemd.device">
27 <title>systemd.device</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>systemd.device</refentrytitle>
42 <manvolnum>5</manvolnum>
46 <refname>systemd.device</refname>
47 <refpurpose>Device unit configuration</refpurpose>
51 <para><filename>systemd.device</filename></para>
55 <title>Description</title>
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>
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
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
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>
92 <title>The udev Database</title>
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>
99 <variablelist class='udev-directives'>
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>
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>
126 <term><varname>SYSTEMD_READY=</varname></term>
127 <listitem><para>If set to 0 systemd
128 will consider this device unplugged
129 even if it shows up in the udev
130 tree. If this property is unset or set
131 to 1 the device will be considered
132 plugged the moment it shows up in the
133 udev tree. This property has no
134 influence on the behavior when a
135 device disappears from the udev
136 tree. This option is useful to support
137 devices that initially show up in an
138 uninitialized state in the tree, and for
139 which a changed event is generated the
140 moment they are fully set
141 up.</para></listitem>
145 <term><varname>ID_MODEL_FROM_DATABASE=</varname></term>
146 <term><varname>ID_MODEL=</varname></term>
148 <listitem><para>If set, this property is
149 used as description string for the
150 device unit.</para></listitem>
159 <title>See Also</title>
161 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
162 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
163 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
164 <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
165 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>