]> git.proxmox.com Git - systemd.git/blob - man/systemd.device.html
Imported Upstream version 217
[systemd.git] / man / systemd.device.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd.device</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 217</span><hr><div class="refentry"><a name="systemd.device"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd.device — Device unit configuration</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename"><em class="replaceable"><code>device</code></em>.device</code></p></div><div class="refsect1"><a name="idm214169484112"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p>A unit configuration file whose name ends in
23 "<code class="literal">.device</code>" encodes information about
24 a device unit as exposed in the
25 sysfs/<a href="udev.html"><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span></a>
26 device tree.</p><p>This unit type has no specific options. See
27 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
28 for the common options of all unit configuration
29 files. The common configuration items are configured
30 in the generic "<code class="literal">[Unit]</code>" and
31 "<code class="literal">[Install]</code>" sections. A separate
32 "<code class="literal">[Device]</code>" section does not exist,
33 since no device-specific options may be
34 configured.</p><p>systemd will dynamically create device units for
35 all kernel devices that are marked with the "systemd"
36 udev tag (by default all block and network devices,
37 and a few others). This may be used to define
38 dependencies between devices and other units. To tag a
39 udev device, use "<code class="literal">TAG+="systemd"</code>" in
40 the udev rules file, see
41 <a href="udev.html"><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span></a>
42 for details.</p><p>Device units are named after the
43 <code class="filename">/sys</code> and
44 <code class="filename">/dev</code> paths they control. Example:
45 the device <code class="filename">/dev/sda5</code> is exposed
46 in systemd as <code class="filename">dev-sda5.device</code>. For
47 details about the escaping logic used to convert a
48 file system path to a unit name see
49 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>.</p></div><div class="refsect1"><a name="idm214169471024"></a><h2 id="The udev Database">The udev Database<a class="headerlink" title="Permalink to this headline" href="#The%20udev%20Database"></a></h2><p>The settings of device units may either be
50 configured via unit files, or directly from the udev
51 database (which is recommended). The following udev device
52 properties are understood by systemd:</p><div class="variablelist"><dl class="variablelist"><dt id="SYSTEMD_WANTS="><span class="term"><code class="varname">SYSTEMD_WANTS=</code>, </span><span class="term"><code class="varname">SYSTEMD_USER_WANTS=</code></span><a class="headerlink" title="Permalink to this term" href="#SYSTEMD_WANTS="></a></dt><dd><p>Adds dependencies of
53 type <code class="varname">Wants</code> from the
54 device unit to all listed units. The
55 first form is used by the system
56 systemd instance, the second by user
57 systemd instances. Those settings may
58 be used to activate arbitrary units
59 when a specific device becomes
60 available.</p><p>Note that this and the
61 other tags are not taken into account
62 unless the device is tagged with the
63 "<code class="literal">systemd</code>" string in
64 the udev database, because otherwise
65 the device is not exposed as a systemd
66 unit (see above).</p><p>Note that systemd will only act
67 on <code class="varname">Wants</code>
68 dependencies when a device first
69 becomes active. It will not act on
70 them if they are added to devices that
71 are already active. Use
72 <code class="varname">SYSTEMD_READY=</code> (see
73 below) to influence on which udev
74 event to trigger the dependencies.
75 </p></dd><dt id="SYSTEMD_ALIAS="><span class="term"><code class="varname">SYSTEMD_ALIAS=</code></span><a class="headerlink" title="Permalink to this term" href="#SYSTEMD_ALIAS="></a></dt><dd><p>Adds an additional
76 alias name to the device unit. This
77 must be an absolute path that is
78 automatically transformed into a unit
79 name. (See above.)</p></dd><dt id="SYSTEMD_READY="><span class="term"><code class="varname">SYSTEMD_READY=</code></span><a class="headerlink" title="Permalink to this term" href="#SYSTEMD_READY="></a></dt><dd><p>If set to 0, systemd
80 will consider this device unplugged
81 even if it shows up in the udev
82 tree. If this property is unset or set
83 to 1, the device will be considered
84 plugged if it is visible in the
85 udev tree. This property has no
86 influence on the behavior when a
87 device disappears from the udev
88 tree.</p><p>This option is useful to support
89 devices that initially show up in an
90 uninitialized state in the tree, and
91 for which a "<code class="literal">changed</code>"
92 event is generated the moment they are
93 fully set up. Note that
94 <code class="varname">SYSTEMD_WANTS=</code> (see
95 above) is not acted on as long as
96 <code class="varname">SYSTEMD_READY=0</code> is
97 set for a device.</p></dd><dt id="ID_MODEL_FROM_DATABASE="><span class="term"><code class="varname">ID_MODEL_FROM_DATABASE=</code>, </span><span class="term"><code class="varname">ID_MODEL=</code></span><a class="headerlink" title="Permalink to this term" href="#ID_MODEL_FROM_DATABASE="></a></dt><dd><p>If set, this property is
98 used as description string for the
99 device unit.</p></dd></dl></div></div><div class="refsect1"><a name="idm214173405536"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
100 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
101 <a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
102 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>,
103 <a href="udev.html"><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span></a>,
104 <a href="systemd.directives.html"><span class="citerefentry"><span class="refentrytitle">systemd.directives</span>(7)</span></a>
105 </p></div></div></body></html>