]> git.proxmox.com Git - systemd.git/blame - man/systemd.device.5
Imported Upstream version 217
[systemd.git] / man / systemd.device.5
CommitLineData
14228c0d 1'\" t
5eef597e 2.TH "SYSTEMD\&.DEVICE" "5" "" "systemd 217" "systemd.device"
14228c0d
MB
3.\" -----------------------------------------------------------------
4.\" * Define some portability stuff
5.\" -----------------------------------------------------------------
6.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7.\" http://bugs.debian.org/507673
8.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10.ie \n(.g .ds Aq \(aq
11.el .ds Aq '
12.\" -----------------------------------------------------------------
13.\" * set default formatting
14.\" -----------------------------------------------------------------
15.\" disable hyphenation
16.nh
17.\" disable justification (adjust text to left margin only)
18.ad l
19.\" -----------------------------------------------------------------
20.\" * MAIN CONTENT STARTS HERE *
21.\" -----------------------------------------------------------------
22.SH "NAME"
23systemd.device \- Device unit configuration
24.SH "SYNOPSIS"
25.PP
26\fIdevice\fR\&.device
27.SH "DESCRIPTION"
28.PP
29A unit configuration file whose name ends in
30"\&.device"
31encodes information about a device unit as exposed in the sysfs/\fBudev\fR(7)
32device tree\&.
33.PP
34This unit type has no specific options\&. See
35\fBsystemd.unit\fR(5)
36for the common options of all unit configuration files\&. The common configuration items are configured in the generic
37"[Unit]"
38and
39"[Install]"
40sections\&. A separate
41"[Device]"
42section does not exist, since no device\-specific options may be configured\&.
43.PP
60f067b4
JS
44systemd 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
45"TAG+="systemd""
46in the udev rules file, see
47\fBudev\fR(7)
48for details\&.
14228c0d
MB
49.PP
50Device units are named after the
51/sys
52and
53/dev
54paths they control\&. Example: the device
55/dev/sda5
56is exposed in systemd as
57dev\-sda5\&.device\&. For details about the escaping logic used to convert a file system path to a unit name see
58\fBsystemd.unit\fR(5)\&.
59.SH "THE UDEV DATABASE"
60.PP
60f067b4 61The 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:
14228c0d 62.PP
60f067b4 63\fISYSTEMD_WANTS=\fR, \fISYSTEMD_USER_WANTS=\fR
14228c0d
MB
64.RS 4
65Adds dependencies of type
66\fIWants\fR
60f067b4
JS
67from 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\&.
68.sp
69Note that this and the other tags are not taken into account unless the device is tagged with the
14228c0d 70"systemd"
60f067b4
JS
71string in the udev database, because otherwise the device is not exposed as a systemd unit (see above)\&.
72.sp
73Note that systemd will only act on
74\fIWants\fR
75dependencies when a device first becomes active\&. It will not act on them if they are added to devices that are already active\&. Use
76\fISYSTEMD_READY=\fR
77(see below) to influence on which udev event to trigger the dependencies\&.
14228c0d
MB
78.RE
79.PP
80\fISYSTEMD_ALIAS=\fR
81.RS 4
82Adds an additional alias name to the device unit\&. This must be an absolute path that is automatically transformed into a unit name\&. (See above\&.)
83.RE
84.PP
85\fISYSTEMD_READY=\fR
86.RS 4
60f067b4
JS
87If 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\&.
88.sp
89This option is useful to support devices that initially show up in an uninitialized state in the tree, and for which a
90"changed"
91event is generated the moment they are fully set up\&. Note that
92\fISYSTEMD_WANTS=\fR
93(see above) is not acted on as long as
94\fISYSTEMD_READY=0\fR
95is set for a device\&.
14228c0d
MB
96.RE
97.PP
98\fIID_MODEL_FROM_DATABASE=\fR, \fIID_MODEL=\fR
99.RS 4
100If set, this property is used as description string for the device unit\&.
101.RE
102.SH "SEE ALSO"
103.PP
104\fBsystemd\fR(1),
5eef597e 105\fBsystemctl\fR(1),
14228c0d
MB
106\fBsystemd.unit\fR(5),
107\fBudev\fR(7),
108\fBsystemd.directives\fR(7)