]>
Commit | Line | Data |
---|---|---|
663996b3 MS |
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>· | |
e735f4d4 MP |
22 | <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</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="idm140133170137984"></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 a device unit | |
24 | 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 files. The common | |
29 | configuration items are configured in the generic | |
30 | "<code class="literal">[Unit]</code>" and "<code class="literal">[Install]</code>" | |
31 | sections. A separate "<code class="literal">[Device]</code>" section does not | |
32 | exist, since no device-specific options may be configured.</p><p>systemd will dynamically create device units for all kernel | |
33 | devices that are marked with the "systemd" udev tag (by default | |
34 | all block and network devices, and a few others). This may be used | |
35 | to define dependencies between devices and other units. To tag a | |
36 | udev device, use "<code class="literal">TAG+="systemd"</code>" in the udev | |
37 | rules file, see | |
38 | <a href="udev.html"><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span></a> | |
39 | for details.</p><p>Device units are named after the <code class="filename">/sys</code> | |
40 | and <code class="filename">/dev</code> paths they control. Example: the | |
41 | device <code class="filename">/dev/sda5</code> is exposed in | |
42 | systemd as <code class="filename">dev-sda5.device</code>. For details about | |
43 | the escaping logic used to convert a file system path to a unit | |
44 | name see | |
45 | <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>.</p></div><div class="refsect1"><a name="idm140133166577520"></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 configured via | |
46 | unit files, or directly from the udev database (which is | |
47 | recommended). The following udev device properties are understood | |
48 | 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 type | |
49 | <code class="varname">Wants</code> from the device unit to all listed | |
50 | units. The first form is used by the system systemd instance, | |
51 | the second by user systemd instances. Those settings may be | |
52 | used to activate arbitrary units when a specific device | |
53 | becomes available.</p><p>Note that this and the other tags are not taken into | |
54 | account unless the device is tagged with the | |
55 | "<code class="literal">systemd</code>" string in the udev database, | |
56 | because otherwise the device is not exposed as a systemd unit | |
57 | (see above).</p><p>Note that systemd will only act on | |
58 | <code class="varname">Wants</code> dependencies when a device first | |
59 | becomes active. It will not act on them if they are added to | |
60 | devices that are already active. Use | |
61 | <code class="varname">SYSTEMD_READY=</code> (see below) to influence on | |
62 | which udev event to trigger the dependencies. | |
63 | </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 alias name to the device | |
64 | unit. This must be an absolute path that is automatically | |
65 | transformed into a unit 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 will consider this device | |
66 | unplugged even if it shows up in the udev tree. If this | |
67 | property is unset or set to 1, the device will be considered | |
68 | plugged if it is visible in the udev tree. This property has | |
69 | no influence on the behavior when a device disappears from the | |
70 | udev tree.</p><p>This option is useful to support devices that initially | |
71 | show up in an uninitialized state in the tree, and for which a | |
72 | "<code class="literal">changed</code>" event is generated the moment they | |
73 | are fully set up. Note that <code class="varname">SYSTEMD_WANTS=</code> | |
74 | (see above) is not acted on as long as | |
75 | <code class="varname">SYSTEMD_READY=0</code> is set for a | |
76 | 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 used as description | |
77 | string for the device unit.</p></dd></dl></div></div><div class="refsect1"><a name="idm140133170279296"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p> | |
78 | <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>, | |
79 | <a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>, | |
80 | <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>, | |
81 | <a href="udev.html"><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span></a>, | |
82 | <a href="systemd.directives.html"><span class="citerefentry"><span class="refentrytitle">systemd.directives</span>(7)</span></a> | |
83 | </p></div></div></body></html> |