1SYSTEMD.DEVICE(5) systemd.device SYSTEMD.DEVICE(5)
2
3
4
6 systemd.device - Device unit configuration
7
9 device.device
10
12 A unit configuration file whose name ends in ".device" encodes
13 information about a device unit as exposed in the sysfs/udev(7) device
14 tree. This may be used to define dependencies between devices and other
15 units.
16
17 This unit type has no specific options. See systemd.unit(5) for the
18 common options of all unit configuration files. The common
19 configuration items are configured in the generic [Unit] and [Install]
20 sections. A separate [Device] section does not exist, since no
21 device-specific options may be configured.
22
23 systemd will dynamically create device units for all kernel devices
24 that are marked with the "systemd" udev tag (by default all block and
25 network devices, and a few others). Note that if systemd-udevd.service
26 is not running, no device units will be available (for example in a
27 typical container).
28
29 Device units are named after the /sys/ and /dev/ paths they control.
30 Example: the device /dev/sda5 is exposed in systemd as dev-sda5.device.
31 For details about the escaping logic used to convert a file system path
32 to a unit name see systemd.unit(5).
33
34 To tag a udev device, use "TAG+="systemd"" in the udev rules file, see
35 udev(7) for details.
36
37 Device units will be reloaded by systemd whenever the corresponding
38 device generates a "changed" event. Other units can use
39 ReloadPropagatedFrom= to react to that event.
40
42 Implicit Dependencies
43 Many unit types automatically acquire dependencies on device units of
44 devices they require. For example, .socket unit acquire dependencies on
45 the device units of the network interface specified in BindToDevice=.
46 Similar, swap and mount units acquire dependencies on the units
47 encapsulating their backing block devices.
48
49 Default Dependencies
50 There are no default dependencies for device units.
51
53 Unit settings of device units may either be configured via unit files,
54 or directly from the udev database. The following udev device
55 properties are understood by the service manager:
56
57 SYSTEMD_WANTS=, SYSTEMD_USER_WANTS=
58 Adds dependencies of type Wants= from the device unit to the
59 specified units. SYSTEMD_WANTS= is read by the system service
60 manager, SYSTEMD_USER_WANTS= by user service manager instances.
61 These properties may be used to activate arbitrary units when a
62 specific device becomes available.
63
64 Note that this and the other udev device properties are not taken
65 into account unless the device is tagged with the "systemd" tag in
66 the udev database, because otherwise the device is not exposed as a
67 systemd unit (see above).
68
69 Note that systemd will only act on Wants= dependencies when a
70 device first becomes active. It will not act on them if they are
71 added to devices that are already active. Use SYSTEMD_READY= (see
72 below) to configure when a udev device shall be considered active,
73 and thus when to trigger the dependencies.
74
75 The specified property value should be a space-separated list of
76 valid unit names. If a unit template name is specified (that is, a
77 unit name containing an "@" character indicating a unit name to use
78 for multiple instantiation, but with an empty instance name
79 following the "@"), it will be automatically instantiated by the
80 device's "sysfs" path (that is: the path is escaped and inserted as
81 instance name into the template unit name). This is useful in order
82 to instantiate a specific template unit once for each device that
83 appears and matches specific properties.
84
85 SYSTEMD_ALIAS=
86 Adds an additional alias name to the device unit. This must be an
87 absolute path that is automatically transformed into a unit name.
88 (See above.)
89
90 SYSTEMD_READY=
91 If set to 0, systemd will consider this device unplugged even if it
92 shows up in the udev tree. If this property is unset or set to 1,
93 the device will be considered plugged if it is visible in the udev
94 tree.
95
96 This option is useful for devices that initially show up in an
97 uninitialized state in the tree, and for which a "changed" event is
98 generated the moment they are fully set up. Note that
99 SYSTEMD_WANTS= (see above) is not acted on as long as
100 SYSTEMD_READY=0 is set for a device.
101
102 ID_MODEL_FROM_DATABASE=, ID_MODEL=
103 If set, this property is used as description string for the device
104 unit.
105
107 Device unit files may include [Unit] and [Install] sections, which are
108 described in systemd.unit(5). No options specific to this file type are
109 supported.
110
112 systemd(1), systemctl(1), systemd.unit(5), udev(7),
113 systemd.directives(7)
114
115
116
117systemd 253 SYSTEMD.DEVICE(5)