systemd/man/systemd.device.html
2015-02-17 11:22:16 +01:00

84 lines
7.3 KiB
HTML

<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>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
<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
"<code class="literal">.device</code>" encodes information about a device unit
as exposed in the
sysfs/<a href="udev.html"><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span></a>
device tree.</p><p>This unit type has no specific options. See
<a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
for the common options of all unit configuration files. The common
configuration items are configured in the generic
"<code class="literal">[Unit]</code>" and "<code class="literal">[Install]</code>"
sections. A separate "<code class="literal">[Device]</code>" section does not
exist, since no device-specific options may be configured.</p><p>systemd will dynamically create device units for all kernel
devices that are marked with the "systemd" udev tag (by default
all block and network devices, and a few others). This may be used
to define dependencies between devices and other units. To tag a
udev device, use "<code class="literal">TAG+="systemd"</code>" in the udev
rules file, see
<a href="udev.html"><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span></a>
for details.</p><p>Device units are named after the <code class="filename">/sys</code>
and <code class="filename">/dev</code> paths they control. Example: the
device <code class="filename">/dev/sda5</code> is exposed in
systemd as <code class="filename">dev-sda5.device</code>. For details about
the escaping logic used to convert a file system path to a unit
name see
<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
unit files, or directly from the udev database (which is
recommended). The following udev device 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 type
<code class="varname">Wants</code> from the device unit to all listed
units. The first form is used by the system systemd instance,
the second by user systemd instances. Those settings may be
used to activate arbitrary units when a specific device
becomes available.</p><p>Note that this and the other tags are not taken into
account unless the device is tagged with the
"<code class="literal">systemd</code>" string in the udev database,
because otherwise the device is not exposed as a systemd unit
(see above).</p><p>Note that systemd will only act on
<code class="varname">Wants</code> dependencies when a device first
becomes active. It will not act on them if they are added to
devices that are already active. Use
<code class="varname">SYSTEMD_READY=</code> (see below) to influence on
which udev event to trigger the dependencies.
</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
unit. This must be an absolute path that is automatically
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
unplugged even if it shows up in the udev tree. If this
property is unset or set to 1, the device will be considered
plugged if it is visible in the udev tree. This property has
no influence on the behavior when a device disappears from the
udev tree.</p><p>This option is useful to support devices that initially
show up in an uninitialized state in the tree, and for which a
"<code class="literal">changed</code>" event is generated the moment they
are fully set up. Note that <code class="varname">SYSTEMD_WANTS=</code>
(see above) is not acted on as long as
<code class="varname">SYSTEMD_READY=0</code> is 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 used as description
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>
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
<a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>,
<a href="udev.html"><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span></a>,
<a href="systemd.directives.html"><span class="citerefentry"><span class="refentrytitle">systemd.directives</span>(7)</span></a>
</p></div></div></body></html>