| 1 |
<?xml version='1.0'?> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="systemd-udevd.service" |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 8 |
|
| 9 |
<refentryinfo> |
| 10 |
<title>systemd-udevd.service</title> |
| 11 |
<productname>systemd</productname> |
| 12 |
</refentryinfo> |
| 13 |
|
| 14 |
<refmeta> |
| 15 |
<refentrytitle>systemd-udevd.service</refentrytitle> |
| 16 |
<manvolnum>8</manvolnum> |
| 17 |
</refmeta> |
| 18 |
|
| 19 |
<refnamediv> |
| 20 |
<refname>systemd-udevd.service</refname> |
| 21 |
<refname>systemd-udevd-control.socket</refname> |
| 22 |
<refname>systemd-udevd-kernel.socket</refname> |
| 23 |
<refname>systemd-udevd-varlink.socket</refname> |
| 24 |
<refname>systemd-udevd</refname> |
| 25 |
<refpurpose>Device event managing daemon</refpurpose> |
| 26 |
</refnamediv> |
| 27 |
|
| 28 |
<refsynopsisdiv> |
| 29 |
<para><filename>systemd-udevd.service</filename></para> |
| 30 |
<para><filename>systemd-udevd-control.socket</filename></para> |
| 31 |
<para><filename>systemd-udevd-kernel.socket</filename></para> |
| 32 |
<para><filename>systemd-udevd-varlink.socket</filename></para> |
| 33 |
|
| 34 |
<cmdsynopsis> |
| 35 |
<command>/usr/lib/systemd/systemd-udevd</command> |
| 36 |
<arg><option>--daemon</option></arg> |
| 37 |
<arg><option>--debug</option></arg> |
| 38 |
<arg><option>--children-max=</option></arg> |
| 39 |
<arg><option>--exec-delay=</option></arg> |
| 40 |
<arg><option>--event-timeout=</option></arg> |
| 41 |
<arg><option>--resolve-names=early|late|never</option></arg> |
| 42 |
<arg><option>--version</option></arg> |
| 43 |
<arg><option>--help</option></arg> |
| 44 |
</cmdsynopsis> |
| 45 |
|
| 46 |
</refsynopsisdiv> |
| 47 |
|
| 48 |
<refsect1><title>Description</title> |
| 49 |
<para><command>systemd-udevd</command> listens to kernel uevents. |
| 50 |
For every event, systemd-udevd executes matching instructions |
| 51 |
specified in udev rules. See <citerefentry> |
| 52 |
<refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum> |
| 53 |
</citerefentry>.</para> |
| 54 |
|
| 55 |
<para>The behavior of the daemon can be configured using |
| 56 |
<citerefentry><refentrytitle>udev.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
| 57 |
its command line options, environment variables, and on the kernel |
| 58 |
command line, or changed dynamically with <command>udevadm |
| 59 |
control</command>. |
| 60 |
</para> |
| 61 |
</refsect1> |
| 62 |
|
| 63 |
<refsect1><title>Options</title> |
| 64 |
<variablelist> |
| 65 |
<varlistentry> |
| 66 |
<term><option>-d</option></term> |
| 67 |
<term><option>--daemon</option></term> |
| 68 |
<listitem> |
| 69 |
<para>Detach and run in the background.</para> |
| 70 |
|
| 71 |
<xi:include href="version-info.xml" xpointer="v186"/> |
| 72 |
</listitem> |
| 73 |
</varlistentry> |
| 74 |
|
| 75 |
<varlistentry> |
| 76 |
<term><option>-D</option></term> |
| 77 |
<term><option>--debug</option></term> |
| 78 |
<listitem> |
| 79 |
<para>Print debug messages to standard error.</para> |
| 80 |
|
| 81 |
<xi:include href="version-info.xml" xpointer="v186"/> |
| 82 |
</listitem> |
| 83 |
</varlistentry> |
| 84 |
|
| 85 |
<varlistentry> |
| 86 |
<term><option>-c</option></term> |
| 87 |
<term><option>--children-max=</option></term> |
| 88 |
<listitem> |
| 89 |
<para>Limit the number of events executed in parallel.</para> |
| 90 |
|
| 91 |
<xi:include href="version-info.xml" xpointer="v186"/> |
| 92 |
</listitem> |
| 93 |
</varlistentry> |
| 94 |
|
| 95 |
<varlistentry> |
| 96 |
<term><option>-e</option></term> |
| 97 |
<term><option>--exec-delay=</option></term> |
| 98 |
<listitem> |
| 99 |
<para>Delay the execution of each <varname>RUN{<replaceable>program</replaceable>}</varname> |
| 100 |
parameter by the given number of seconds. This option |
| 101 |
might be useful when debugging system crashes during |
| 102 |
coldplug caused by loading non-working kernel |
| 103 |
modules.</para> |
| 104 |
|
| 105 |
<xi:include href="version-info.xml" xpointer="v186"/> |
| 106 |
</listitem> |
| 107 |
</varlistentry> |
| 108 |
|
| 109 |
<varlistentry> |
| 110 |
<term><option>-t</option></term> |
| 111 |
<term><option>--event-timeout=</option></term> |
| 112 |
<listitem> |
| 113 |
<para>Set the number of seconds to wait for events to finish. After |
| 114 |
this time, the event will be terminated. The default is 180 seconds.</para> |
| 115 |
|
| 116 |
<xi:include href="version-info.xml" xpointer="v216"/> |
| 117 |
</listitem> |
| 118 |
</varlistentry> |
| 119 |
|
| 120 |
<varlistentry> |
| 121 |
<term><option>-s</option></term> |
| 122 |
<term><option>--timeout-signal=</option></term> |
| 123 |
<listitem> |
| 124 |
<para>Set the signal which <filename>systemd-udevd</filename> will send to |
| 125 |
forked off processes after reaching event timeout. The setting can be overridden |
| 126 |
at boot time with the kernel command line option |
| 127 |
<varname>udev.timeout_signal=</varname>. Setting to <constant>SIGABRT</constant> |
| 128 |
may be helpful in order to debug worker timeouts. Defaults to |
| 129 |
<constant>SIGKILL</constant>. Note that setting the option on the command line |
| 130 |
overrides the setting from the configuration file. |
| 131 |
</para> |
| 132 |
|
| 133 |
<xi:include href="version-info.xml" xpointer="v246"/> |
| 134 |
</listitem> |
| 135 |
</varlistentry> |
| 136 |
|
| 137 |
<varlistentry> |
| 138 |
<term><option>-N</option></term> |
| 139 |
<term><option>--resolve-names=</option></term> |
| 140 |
<listitem> |
| 141 |
<para>Specify when systemd-udevd should resolve names of users and groups. |
| 142 |
When set to <option>early</option> (the default), names will be |
| 143 |
resolved when the rules are parsed. When set to |
| 144 |
<option>late</option>, names will be resolved for every event. |
| 145 |
When set to <option>never</option>, names will never be resolved |
| 146 |
and all devices will be owned by root.</para> |
| 147 |
|
| 148 |
<xi:include href="version-info.xml" xpointer="v186"/> |
| 149 |
</listitem> |
| 150 |
</varlistentry> |
| 151 |
|
| 152 |
<xi:include href="standard-options.xml" xpointer="help" /> |
| 153 |
<xi:include href="standard-options.xml" xpointer="version" /> |
| 154 |
</variablelist> |
| 155 |
</refsect1> |
| 156 |
|
| 157 |
<refsect1><title>Kernel command line</title> |
| 158 |
<variablelist class='kernel-commandline-options'> |
| 159 |
<para>Parameters prefixed with "rd." will be read when <command>systemd-udevd</command> is used in an |
| 160 |
initrd, those without will be processed both in the initrd and on the host.</para> |
| 161 |
<varlistentry> |
| 162 |
<term><varname>udev.log_level=</varname></term> |
| 163 |
<term><varname>rd.udev.log_level=</varname></term> |
| 164 |
<listitem> |
| 165 |
<para>Set the log level.</para> |
| 166 |
|
| 167 |
<xi:include href="version-info.xml" xpointer="v247"/> |
| 168 |
</listitem> |
| 169 |
</varlistentry> |
| 170 |
<varlistentry> |
| 171 |
<term><varname>udev.trace[=<replaceable>BOOL</replaceable>]</varname></term> |
| 172 |
<term><varname>rd.udev.trace[=<replaceable>BOOL</replaceable>]</varname></term> |
| 173 |
<listitem> |
| 174 |
<para>Enable/disable trace logging. When enabled, <varname>udev.log_level=</varname> will be |
| 175 |
ignored, and <literal>debug</literal> level is assumed.</para> |
| 176 |
|
| 177 |
<xi:include href="version-info.xml" xpointer="v258"/> |
| 178 |
</listitem> |
| 179 |
</varlistentry> |
| 180 |
<varlistentry> |
| 181 |
<term><varname>udev.children_max=</varname></term> |
| 182 |
<term><varname>rd.udev.children_max=</varname></term> |
| 183 |
<listitem> |
| 184 |
<para>Limit the number of events executed in parallel.</para> |
| 185 |
|
| 186 |
<xi:include href="version-info.xml" xpointer="v186"/> |
| 187 |
</listitem> |
| 188 |
</varlistentry> |
| 189 |
<varlistentry> |
| 190 |
<term><varname>udev.exec_delay=</varname></term> |
| 191 |
<term><varname>rd.udev.exec_delay=</varname></term> |
| 192 |
<listitem> |
| 193 |
<para>Delay the execution of each <varname>RUN{<replaceable>program</replaceable>}</varname> parameter by the given |
| 194 |
number of seconds. This option might be useful when |
| 195 |
debugging system crashes during coldplug caused by loading |
| 196 |
non-working kernel modules.</para> |
| 197 |
|
| 198 |
<xi:include href="version-info.xml" xpointer="v186"/> |
| 199 |
</listitem> |
| 200 |
</varlistentry> |
| 201 |
<varlistentry> |
| 202 |
<term><varname>udev.event_timeout=</varname></term> |
| 203 |
<term><varname>rd.udev.event_timeout=</varname></term> |
| 204 |
<listitem> |
| 205 |
<para>Wait for events to finish up to the given number |
| 206 |
of seconds. This option might be useful if events are |
| 207 |
terminated due to kernel drivers taking too long to initialize.</para> |
| 208 |
|
| 209 |
<xi:include href="version-info.xml" xpointer="v216"/> |
| 210 |
</listitem> |
| 211 |
</varlistentry> |
| 212 |
<varlistentry> |
| 213 |
<term><varname>udev.timeout_signal=</varname></term> |
| 214 |
<term><varname>rd.udev.timeout_signal=</varname></term> |
| 215 |
<listitem> |
| 216 |
<para>Specifies a signal that <filename>systemd-udevd</filename> will send to |
| 217 |
workers on timeout. Note that kernel command line option overrides both the |
| 218 |
setting in the configuration file and the one on the program command line.</para> |
| 219 |
|
| 220 |
<xi:include href="version-info.xml" xpointer="v246"/> |
| 221 |
</listitem> |
| 222 |
</varlistentry> |
| 223 |
<varlistentry> |
| 224 |
<term><varname>udev.blockdev_read_only</varname></term> |
| 225 |
<term><varname>rd.udev.blockdev_read_only</varname></term> |
| 226 |
<listitem> |
| 227 |
<para>If specified, mark all physical block devices read-only as they appear. Synthetic block |
| 228 |
devices (such as loopback block devices or device mapper devices) are left as they are. This is |
| 229 |
useful to guarantee that the contents of physical block devices remains unmodified during runtime, |
| 230 |
for example to implement fully stateless systems, for testing or for recovery situations where |
| 231 |
corrupted file systems shall not be corrupted further through accidental modification.</para> |
| 232 |
|
| 233 |
<para>A block device may be marked writable again by issuing the <command>blockdev |
| 234 |
--setrw</command> command, see <citerefentry |
| 235 |
project='man-pages'><refentrytitle>blockdev</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 236 |
for details.</para> |
| 237 |
|
| 238 |
<xi:include href="version-info.xml" xpointer="v246"/> |
| 239 |
</listitem> |
| 240 |
</varlistentry> |
| 241 |
<varlistentry> |
| 242 |
<term><varname>net.ifnames=</varname></term> |
| 243 |
<listitem> |
| 244 |
<para>Network interfaces are renamed to give them predictable names |
| 245 |
when possible. It is enabled by default; specifying 0 disables it.</para> |
| 246 |
|
| 247 |
<xi:include href="version-info.xml" xpointer="v199"/> |
| 248 |
</listitem> |
| 249 |
</varlistentry> |
| 250 |
<varlistentry> |
| 251 |
<term><varname>net.naming_scheme=</varname></term> |
| 252 |
<listitem> |
| 253 |
<para>Network interfaces are renamed to give them predictable names when possible (unless |
| 254 |
<varname>net.ifnames=0</varname> is specified, see above). With this kernel command line option it |
| 255 |
is possible to pick a specific version of this algorithm and override the default chosen at |
| 256 |
compilation time. Expects one of the naming scheme identifiers listed in |
| 257 |
<citerefentry><refentrytitle>systemd.net-naming-scheme</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
| 258 |
or <literal>latest</literal> to select the latest scheme known (to this particular version of |
| 259 |
<filename>systemd-udevd.service</filename>).</para> |
| 260 |
|
| 261 |
<para>Note that selecting a specific scheme is not sufficient to fully stabilize interface naming: |
| 262 |
the naming is generally derived from driver attributes exposed by the kernel. As the kernel is |
| 263 |
updated, previously missing attributes <filename>systemd-udevd.service</filename> is checking might |
| 264 |
appear, which affects older name derivation algorithms, too.</para> |
| 265 |
|
| 266 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 267 |
</listitem> |
| 268 |
</varlistentry> |
| 269 |
<varlistentry> |
| 270 |
<term><varname>net.ifname_policy=<replaceable>policy1</replaceable>[,<replaceable>policy2</replaceable>,…][,<replaceable>MAC</replaceable>]</varname></term> |
| 271 |
<listitem> |
| 272 |
<para>Specifies naming policies applied when renaming network interfaces. Takes a list of |
| 273 |
policies and an optional MAC address separated with comma. Each policy value must be one of |
| 274 |
the policies understood by the <varname>NamePolicy=</varname> setting in .link files, e.g. |
| 275 |
<literal>onboard</literal> or <literal>path</literal>. See |
| 276 |
<citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 277 |
for more details. When the MAC address is specified, the policies are applied to the |
| 278 |
interface which has the address. When no MAC address is specified, the policies are applied |
| 279 |
to all interfaces. This kernel command line argument can be specified multiple times.</para> |
| 280 |
|
| 281 |
<para>This argument is not directly read by <command>systemd-udevd</command>, but is instead |
| 282 |
converted to a .link file by |
| 283 |
<citerefentry><refentrytitle>systemd-network-generator.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
| 284 |
For this argument to take effect, <filename>systemd-network-generator.service</filename> must be |
| 285 |
enabled.</para> |
| 286 |
|
| 287 |
<para>Example: |
| 288 |
<programlisting>net.ifname_policy=keep,kernel,path,slot,onboard,01:23:45:67:89:ab |
| 289 |
net.ifname_policy=keep,kernel,path,slot,onboard,mac</programlisting> |
| 290 |
This is mostly equivalent to creating the following .link files: |
| 291 |
<programlisting># 91-name-policy-with-mac.link |
| 292 |
[Match] |
| 293 |
MACAddress=01:23:45:67:89:ab |
| 294 |
|
| 295 |
[Link] |
| 296 |
NamePolicy=keep kernel path slot onboard |
| 297 |
AlternativeNamePolicy=path slot onboard</programlisting> |
| 298 |
and |
| 299 |
<programlisting># 92-name-policy-for-all.link |
| 300 |
[Match] |
| 301 |
OriginalName=* |
| 302 |
|
| 303 |
[Link] |
| 304 |
NamePolicy=keep kernel path slot onboard mac |
| 305 |
AlternativeNamePolicy=path slot onboard mac</programlisting> |
| 306 |
</para> |
| 307 |
|
| 308 |
<xi:include href="version-info.xml" xpointer="v250"/> |
| 309 |
</listitem> |
| 310 |
</varlistentry> |
| 311 |
</variablelist> |
| 312 |
<!-- when adding entries here, consider also adding them in kernel-command-line.xml --> |
| 313 |
</refsect1> |
| 314 |
|
| 315 |
<refsect1> |
| 316 |
<title>See Also</title> |
| 317 |
<para><simplelist type="inline"> |
| 318 |
<member><citerefentry><refentrytitle>udev.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> |
| 319 |
<member><citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry></member> |
| 320 |
<member><citerefentry><refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 321 |
</simplelist></para> |
| 322 |
</refsect1> |
| 323 |
</refentry> |