systemd.device.xml revision 419173e60a05424008fcd312f6df4b59b2ce8e62
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend<?xml version='1.0'?> <!--*-nxml-*-->
2d0611ffc9f91c5fc2ddccb93f9a3d17791ae650takashi<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend
7ec4d5cc4aa574e3191bc5a612e68fd8f25ab7earpluem<!--
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend This file is part of systemd.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend
b4a00883f358625923365ca1560c96edec172a52sf Copyright 2010 Lennart Poettering
50c04f297d76a57ead2fa6b73845f7563b1fc788sf
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend systemd is free software; you can redistribute it and/or modify it
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend under the terms of the GNU Lesser General Public License as published by
d9b843d090f14405079b4a61a493316cd3f1e5b9minfrin the Free Software Foundation; either version 2.1 of the License, or
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend (at your option) any later version.
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes
909ce17e2bd0faef7b1c294f2307f009793fd493nd systemd is distributed in the hope that it will be useful, but
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend WITHOUT ANY WARRANTY; without even the implied warranty of
0ce5630695a7aa568811a9dd0aceedd685f040dend MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a29610af88e278144045bfa1bc63b4a1a4b5ff14trawick Lesser General Public License for more details.
42af92a661a06b3cebc88d585aad75064a309d51nd
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes You should have received a copy of the GNU Lesser General Public License
6fe26506780e73be2a412d758af77fafdf03291and along with systemd; If not, see <http://www.gnu.org/licenses/>.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend-->
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend<refentry id="systemd.device">
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <refentryinfo>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <title>systemd.device</title>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <productname>systemd</productname>
43f6cc6aa3312619633538b8978619a48c0ce52eminfrin
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <authorgroup>
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin <author>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <contrib>Developer</contrib>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <firstname>Lennart</firstname>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <surname>Poettering</surname>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <email>lennart@poettering.net</email>
7906201913b68fe78b9d6a22ab33bf21d82c490eminfrin </author>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend </authorgroup>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend </refentryinfo>
05ede5110427cb9dc071cc671d5aaba5d3b88c79nd
e8b603fa9ccf7b17b11b42df6d8916fd97c2331dnd <refmeta>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <refentrytitle>systemd.device</refentrytitle>
2f39535ac2206b346dcfbcaf271e3addc901f520rbowen <manvolnum>5</manvolnum>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend </refmeta>
d6ce05b6521a82cc93da69f7c2116c4a5bc54f8cjim
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <refnamediv>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <refname>systemd.device</refname>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <refpurpose>Device unit configuration</refpurpose>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend </refnamediv>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <refsynopsisdiv>
03a4ff9ac4c9b8009249010e7c53bb86ff05915and <para><filename><replaceable>device</replaceable>.device</filename></para>
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin </refsynopsisdiv>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend
1e367a83311e5243e04d68857d007d04765a48f9chrisd <refsect1>
1e367a83311e5243e04d68857d007d04765a48f9chrisd <title>Description</title>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend
7d15331eeb5429d7148d13d6fd914a641bf1c000pquerna <para>A unit configuration file whose name ends in
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <literal>.device</literal> encodes information about
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend a device unit as exposed in the
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend sysfs/<citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>
2704de98885368683621b01c8f8f4e4b01557611takashi device tree.</para>
2704de98885368683621b01c8f8f4e4b01557611takashi
2704de98885368683621b01c8f8f4e4b01557611takashi <para>This unit type has no specific options. See
1e367a83311e5243e04d68857d007d04765a48f9chrisd <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend for the common options of all unit configuration
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend files. The common configuration items are configured
c819c19c2f1ffbf3a3f12a4070cc6c3f4ea2a6f2sf in the generic <literal>[Unit]</literal> and
d2b809e5d72658bff23819d8b77f20e4939af541nd <literal>[Install]</literal> sections. A separate
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <literal>[Device]</literal> section does not exist,
fb51a6b789d85113d0976148685b0063c294220drbowen since no device-specific options may be
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend configured.</para>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <para>systemd will dynamically create device units for
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend all kernel devices that are marked with the "systemd"
27d778df0b517e1578f907d2e51eb961cd8ee5fbjim udev tag (by default all block and network devices,
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend and a few others). This may be used to define
6b0fe1f447ba35827cd5cf1d2a703bd8517f33ffmturk dependencies between devices and other units. To tag a
6b0fe1f447ba35827cd5cf1d2a703bd8517f33ffmturk udev device use <literal>TAG+="systemd"</literal> in
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend the udev rules file, see
438b4817913a5ff55d9cad4c7ddf133330b4466ejim <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi for details.</para>
f73390048b37c973a8016ffd22108d7a73c6cc22pquerna
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <para>Device units are named after the
4126704c4950bfd46d32ad54e3b106ac6d868a73sf <filename>/sys</filename> and
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <filename>/dev</filename> paths they control. Example:
0a69d9bb491d9810892a9949c01403a1de3c7ac2nd the device <filename noindex='true'>/dev/sda5</filename> is exposed
ebdfe3e677aaa92fe2df702295eac81a97a4610frbowen in systemd as <filename>dev-sda5.device</filename>. For
68c4447ba8e057cf38cbbec918e0549b817f20b4minfrin details about the escaping logic used to convert a
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe file system path to a unit name see
5332c9934b1c0136e9cd4815fe7d70b79d83fddcsf <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
623eebe956d9c2d6d073ed3eae855b56030b40e9noodl
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend </refsect1>
79b024b81f6bb3c44dce77a7552191daf8b522d2jim
4277c95b5a9454a5c25f8d8762634fcff37aa840minfrin <refsect1>
4277c95b5a9454a5c25f8d8762634fcff37aa840minfrin <title>The udev Database</title>
4277c95b5a9454a5c25f8d8762634fcff37aa840minfrin
f195a136dcd90148b116fdae8ce95b41ba92b87eminfrin <para>The settings of device units may either be
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend configured via unit files, or directly from the udev
1de1266f0ea387d6373be8415745dfd2ab876341jim database (which is recommended). The following udev device
1de1266f0ea387d6373be8415745dfd2ab876341jim properties are understood by systemd:</para>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend
856894d144a15ef1671032a17965bd00b430d311minfrin <variablelist class='udev-directives'>
856894d144a15ef1671032a17965bd00b430d311minfrin <varlistentry>
856894d144a15ef1671032a17965bd00b430d311minfrin <term><varname>SYSTEMD_WANTS=</varname></term>
856894d144a15ef1671032a17965bd00b430d311minfrin <listitem><para>Adds dependencies of
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend type <varname>Wants</varname> from
0ce5630695a7aa568811a9dd0aceedd685f040dend the device unit to all listed units. This
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend may be used to activate arbitrary
10eed2803538d660048f6e733602e82a75ef6885noodl units when a specific device becomes
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend available. Note that this and the
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend other tags are not taken into account
4db28ee269aa06f7c6232e11cd01f58c3349af23noodl unless the device is tagged with the
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <literal>systemd</literal> string in
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend the udev database, because otherwise
03c25fb6f628ac81f2ecb637d1e7502dcee783f3nd the device is not exposed as systemd
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend unit (see above). Note that systemd
4126704c4950bfd46d32ad54e3b106ac6d868a73sf will only act on
0ce5630695a7aa568811a9dd0aceedd685f040dend <varname>Wants</varname> dependencies
7fa75a06a4fee19e995c069ee00310455d1452e1pquerna when a device first becomes active, it
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend will not act on them if they are added
316f02e3836836c82e19019ff23f90a7ebc65289nilgun to devices that are already
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend active. Use
0ce5630695a7aa568811a9dd0aceedd685f040dend <varname>SYSTEMD_READY=</varname> (see
0ce5630695a7aa568811a9dd0aceedd685f040dend below) to influence on which udev
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend event to trigger the device
dependencies.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>SYSTEMD_ALIAS=</varname></term>
<listitem><para>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.)</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>SYSTEMD_READY=</varname></term>
<listitem><para>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 the moment it shows up in the
udev tree. This property has no
influence on the behavior when a
device disappears from the udev
tree. This option is useful to support
devices that initially show up in an
uninitialized state in the tree, and
for which a <literal>changed</literal>
event is generated the moment they are
fully set up. Note that
<varname>SYSTEMD_WANTS=</varname> (see
above) is not acted on as long as
<varname>SYSTEMD_READY=0</varname> is
set for a device.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ID_MODEL_FROM_DATABASE=</varname></term>
<term><varname>ID_MODEL=</varname></term>
<listitem><para>If set, this property is
used as description string for the
device unit.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>