mirror of
https://git.proxmox.com/git/systemd
synced 2026-02-03 06:21:18 +00:00
66 lines
24 KiB
HTML
66 lines
24 KiB
HTML
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>udevadm</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 208</span><hr><div class="refentry"><a name="udevadm"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>udevadm — udev management tool</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">udevadm</code> [<code class="option">--debug</code>] [<code class="option">--version</code>] [<code class="option">--help</code>]</p></div><div class="cmdsynopsis"><p><code class="command">udevadm info <em class="replaceable"><code>options</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm trigger [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm settle [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm control <em class="replaceable"><code>command</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm monitor [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm hwdb [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm test [<span class="optional">options</span>] <em class="replaceable"><code>devpath</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm test-builtin [<span class="optional">options</span>] <em class="replaceable"><code>command</code></em> <em class="replaceable"><code>devpath</code></em></code> </p></div></div><div class="refsect1"><a name="idm274700826992"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>udevadm expects a command and command specific options. It
|
|
controls the runtime behavior of udev, requests kernel events,
|
|
manages the event queue, and provides simple debugging mechanisms.</p></div><div class="refsect1"><a name="idm274701547008"></a><h2 id="OPTIONS">OPTIONS<a class="headerlink" title="Permalink to this headline" href="#OPTIONS">¶</a></h2><div class="variablelist"><dl class="variablelist"><dt id="--debug"><span class="term"><code class="option">--debug</code></span><a class="headerlink" title="Permalink to this term" href="#--debug">¶</a></dt><dd><p>Print debug messages to stderr.</p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version">¶</a></dt><dd><p>Print version number.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help">¶</a></dt><dd><p>Print help text.</p></dd></dl></div><div class="refsect2"><a name="idm274700775072"></a><h3 id="udevadm info options">udevadm info <em class="replaceable"><code>options</code></em><a class="headerlink" title="Permalink to this headline" href="#udevadm%20info%20options">¶</a></h3><p>Queries the udev database for device information
|
|
stored in the udev database. It can also query the properties
|
|
of a device from its sysfs representation to help creating udev
|
|
rules that match this device.</p><div class="variablelist"><dl class="variablelist"><dt id="--query=type"><span class="term"><code class="option">--query=<em class="replaceable"><code>type</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--query=type">¶</a></dt><dd><p>Query the database for specified type of device data. It needs the
|
|
<code class="option">--path</code> or <code class="option">--name</code> to identify the specified
|
|
device. Valid queries are:
|
|
<span class="command"><strong>name</strong></span>, <span class="command"><strong>symlink</strong></span>, <span class="command"><strong>path</strong></span>,
|
|
<span class="command"><strong>property</strong></span>, <span class="command"><strong>all</strong></span>.</p></dd><dt id="--path=devpath"><span class="term"><code class="option">--path=<em class="replaceable"><code>devpath</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--path=devpath">¶</a></dt><dd><p>The devpath of the device to query.</p></dd><dt id="--name=file"><span class="term"><code class="option">--name=<em class="replaceable"><code>file</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--name=file">¶</a></dt><dd><p>The name of the device node or a symlink to query</p></dd><dt id="--root"><span class="term"><code class="option">--root</code></span><a class="headerlink" title="Permalink to this term" href="#--root">¶</a></dt><dd><p>Print absolute paths in <span class="command"><strong>name</strong></span> or <span class="command"><strong>symlink</strong></span>
|
|
query.</p></dd><dt id="--attribute-walk"><span class="term"><code class="option">--attribute-walk</code></span><a class="headerlink" title="Permalink to this term" href="#--attribute-walk">¶</a></dt><dd><p>Print all sysfs properties of the specified device that can be used
|
|
in udev rules to match the specified device. It prints all devices
|
|
along the chain, up to the root of sysfs that can be used in udev rules.</p></dd><dt id="--export"><span class="term"><code class="option">--export</code></span><a class="headerlink" title="Permalink to this term" href="#--export">¶</a></dt><dd><p>Print output as key/value pairs. Values are enclosed in single quotes.</p></dd><dt id="--export-prefix=name"><span class="term"><code class="option">--export-prefix=<em class="replaceable"><code>name</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--export-prefix=name">¶</a></dt><dd><p>Add a prefix to the key name of exported values.</p></dd><dt id="--device-id-of-file=file"><span class="term"><code class="option">--device-id-of-file=<em class="replaceable"><code>file</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--device-id-of-file=file">¶</a></dt><dd><p>Print major/minor numbers of the underlying device, where the file
|
|
lives on.</p></dd><dt id="--export-db"><span class="term"><code class="option">--export-db</code></span><a class="headerlink" title="Permalink to this term" href="#--export-db">¶</a></dt><dd><p>Export the content of the udev database.</p></dd><dt id="--cleanup-db"><span class="term"><code class="option">--cleanup-db</code></span><a class="headerlink" title="Permalink to this term" href="#--cleanup-db">¶</a></dt><dd><p>Cleanup the udev database.</p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version">¶</a></dt><dd><p>Print version.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help">¶</a></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2"><a name="idm274700194000"></a><h3 id="udevadm trigger [options]">udevadm trigger [<span class="optional">options</span>]<a class="headerlink" title="Permalink to this headline" href="#udevadm%20trigger%20%5Boptions%5D">¶</a></h3><p>Request device events from the kernel. Primarily used to replay events at system coldplug time.</p><div class="variablelist"><dl class="variablelist"><dt id="--verbose"><span class="term"><code class="option">--verbose</code></span><a class="headerlink" title="Permalink to this term" href="#--verbose">¶</a></dt><dd><p>Print the list of devices which will be triggered.</p></dd><dt id="--dry-run"><span class="term"><code class="option">--dry-run</code></span><a class="headerlink" title="Permalink to this term" href="#--dry-run">¶</a></dt><dd><p>Do not actually trigger the event.</p></dd><dt id="--type=type"><span class="term"><code class="option">--type=<em class="replaceable"><code>type</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--type=type">¶</a></dt><dd><p>Trigger a specific type of devices. Valid types are:
|
|
<span class="command"><strong>devices</strong></span>, <span class="command"><strong>subsystems</strong></span>.
|
|
The default value is <span class="command"><strong>devices</strong></span>.</p></dd><dt id="--action=action"><span class="term"><code class="option">--action=<em class="replaceable"><code>action</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--action=action">¶</a></dt><dd><p>Type of event to be triggered. The default value is <span class="command"><strong>change</strong></span>.</p></dd><dt id="--subsystem-match=subsystem"><span class="term"><code class="option">--subsystem-match=<em class="replaceable"><code>subsystem</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--subsystem-match=subsystem">¶</a></dt><dd><p>Trigger events for devices which belong to a matching subsystem. This option
|
|
can be specified multiple times and supports shell style pattern matching.</p></dd><dt id="--subsystem-nomatch=subsystem"><span class="term"><code class="option">--subsystem-nomatch=<em class="replaceable"><code>subsystem</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--subsystem-nomatch=subsystem">¶</a></dt><dd><p>Do not trigger events for devices which belong to a matching subsystem. This option
|
|
can be specified multiple times and supports shell style pattern matching.</p></dd><dt id="--attr-match=attribute=value"><span class="term"><code class="option">--attr-match=<em class="replaceable"><code>attribute</code></em>=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--attr-match=attribute=value">¶</a></dt><dd><p>Trigger events for devices with a matching sysfs attribute. If a value is specified
|
|
along with the attribute name, the content of the attribute is matched against the given
|
|
value using shell style pattern matching. If no value is specified, the existence of the
|
|
sysfs attribute is checked. This option can be specified multiple times.</p></dd><dt id="--attr-nomatch=attribute=value"><span class="term"><code class="option">--attr-nomatch=<em class="replaceable"><code>attribute</code></em>=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--attr-nomatch=attribute=value">¶</a></dt><dd><p>Do not trigger events for devices with a matching sysfs attribute. If a value is
|
|
specified along with the attribute name, the content of the attribute is matched against
|
|
the given value using shell style pattern matching. If no value is specified, the existence
|
|
of the sysfs attribute is checked. This option can be specified multiple times.</p></dd><dt id="--property-match=property=value"><span class="term"><code class="option">--property-match=<em class="replaceable"><code>property</code></em>=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--property-match=property=value">¶</a></dt><dd><p>Trigger events for devices with a matching property value. This option can be
|
|
specified multiple times and supports shell style pattern matching.</p></dd><dt id="--tag-match=property"><span class="term"><code class="option">--tag-match=<em class="replaceable"><code>property</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--tag-match=property">¶</a></dt><dd><p>Trigger events for devices with a matching tag. This option can be
|
|
specified multiple times.</p></dd><dt id="--sysname-match=name"><span class="term"><code class="option">--sysname-match=<em class="replaceable"><code>name</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--sysname-match=name">¶</a></dt><dd><p>Trigger events for devices with a matching sys device name. This option can be
|
|
specified multiple times and supports shell style pattern matching.</p></dd><dt id="--parent-match=syspath"><span class="term"><code class="option">--parent-match=<em class="replaceable"><code>syspath</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--parent-match=syspath">¶</a></dt><dd><p>Trigger events for all children of a given device.</p></dd></dl></div></div><div class="refsect2"><a name="idm274703879968"></a><h3 id="udevadm settle [options]">udevadm settle [<span class="optional">options</span>]<a class="headerlink" title="Permalink to this headline" href="#udevadm%20settle%20%5Boptions%5D">¶</a></h3><p>Watches the udev event queue, and exits if all current events are handled.</p><div class="variablelist"><dl class="variablelist"><dt id="--timeout=seconds"><span class="term"><code class="option">--timeout=<em class="replaceable"><code>seconds</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--timeout=seconds">¶</a></dt><dd><p>Maximum number of seconds to wait for the event queue to become empty.
|
|
The default value is 120 seconds. A value of 0 will check if the queue is empty
|
|
and always return immediately.</p></dd><dt id="--seq-start=seqnum"><span class="term"><code class="option">--seq-start=<em class="replaceable"><code>seqnum</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--seq-start=seqnum">¶</a></dt><dd><p>Wait only for events after the given sequence number.</p></dd><dt id="--seq-end=seqnum"><span class="term"><code class="option">--seq-end=<em class="replaceable"><code>seqnum</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--seq-end=seqnum">¶</a></dt><dd><p>Wait only for events before the given sequence number.</p></dd><dt id="--exit-if-exists=file"><span class="term"><code class="option">--exit-if-exists=<em class="replaceable"><code>file</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--exit-if-exists=file">¶</a></dt><dd><p>Stop waiting if file exists.</p></dd><dt id="--quiet"><span class="term"><code class="option">--quiet</code></span><a class="headerlink" title="Permalink to this term" href="#--quiet">¶</a></dt><dd><p>Do not print any output, like the remaining queue entries when reaching the timeout.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help">¶</a></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2"><a name="idm274703859344"></a><h3 id="udevadm control command">udevadm control <em class="replaceable"><code>command</code></em><a class="headerlink" title="Permalink to this headline" href="#udevadm%20control%20command">¶</a></h3><p>Modify the internal state of the running udev daemon.</p><div class="variablelist"><dl class="variablelist"><dt id="--exit"><span class="term"><code class="option">--exit</code></span><a class="headerlink" title="Permalink to this term" href="#--exit">¶</a></dt><dd><p>Signal and wait for systemd-udevd to exit.</p></dd><dt id="--log-priority=value"><span class="term"><code class="option">--log-priority=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--log-priority=value">¶</a></dt><dd><p>Set the internal log level of systemd-udevd. Valid values are the numerical
|
|
syslog priorities or their textual representations: <code class="option">err</code>,
|
|
<code class="option">info</code> and <code class="option">debug</code>.</p></dd><dt id="--stop-exec-queue"><span class="term"><code class="option">--stop-exec-queue</code></span><a class="headerlink" title="Permalink to this term" href="#--stop-exec-queue">¶</a></dt><dd><p>Signal systemd-udevd to stop executing new events. Incoming events
|
|
will be queued.</p></dd><dt id="--start-exec-queue"><span class="term"><code class="option">--start-exec-queue</code></span><a class="headerlink" title="Permalink to this term" href="#--start-exec-queue">¶</a></dt><dd><p>Signal systemd-udevd to enable the execution of events.</p></dd><dt id="--reload"><span class="term"><code class="option">--reload</code></span><a class="headerlink" title="Permalink to this term" href="#--reload">¶</a></dt><dd><p>Signal systemd-udevd to reload the rules files and other databases like the kernel
|
|
module index. Reloading rules and databases does not apply any changes to already
|
|
existing devices; the new configuration will only be applied to new events.</p></dd><dt id="--property=KEY=value"><span class="term"><code class="option">--property=<em class="replaceable"><code>KEY</code></em>=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--property=KEY=value">¶</a></dt><dd><p>Set a global property for all events.</p></dd><dt id="--children-max=value"><span class="term"><code class="option">--children-max=</code><em class="replaceable"><code>value</code></em></span><a class="headerlink" title="Permalink to this term" href="#--children-max=value">¶</a></dt><dd><p>Set the maximum number of events, systemd-udevd will handle at the
|
|
same time.</p></dd><dt id="--timeout=seconds"><span class="term"><code class="option">--timeout=</code><em class="replaceable"><code>seconds</code></em></span><a class="headerlink" title="Permalink to this term" href="#--timeout=seconds">¶</a></dt><dd><p>The maximum number of seconds to wait for a reply from systemd-udevd.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help">¶</a></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2"><a name="idm274702085920"></a><h3 id="udevadm monitor [options]">udevadm monitor [<span class="optional">options</span>]<a class="headerlink" title="Permalink to this headline" href="#udevadm%20monitor%20%5Boptions%5D">¶</a></h3><p>Listens to the kernel uevents and events sent out by a udev rule
|
|
and prints the devpath of the event to the console. It can be used to analyze the
|
|
event timing, by comparing the timestamps of the kernel uevent and the udev event.
|
|
</p><div class="variablelist"><dl class="variablelist"><dt id="--kernel"><span class="term"><code class="option">--kernel</code></span><a class="headerlink" title="Permalink to this term" href="#--kernel">¶</a></dt><dd><p>Print the kernel uevents.</p></dd><dt id="--udev"><span class="term"><code class="option">--udev</code></span><a class="headerlink" title="Permalink to this term" href="#--udev">¶</a></dt><dd><p>Print the udev event after the rule processing.</p></dd><dt id="--property"><span class="term"><code class="option">--property</code></span><a class="headerlink" title="Permalink to this term" href="#--property">¶</a></dt><dd><p>Also print the properties of the event.</p></dd><dt id="--subsystem-match=string[/string]"><span class="term"><code class="option">--subsystem-match=<em class="replaceable"><code>string[/string]</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--subsystem-match=string%5B/string%5D">¶</a></dt><dd><p>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</p></dd><dt id="--tag-match=string"><span class="term"><code class="option">--tag-match=<em class="replaceable"><code>string</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--tag-match=string">¶</a></dt><dd><p>Filter events by property. Only udev events with a given tag attached will pass.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help">¶</a></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2"><a name="idm274702072928"></a><h3 id="udevadm hwdb [options]">udevadm hwdb [<span class="optional">options</span>]<a class="headerlink" title="Permalink to this headline" href="#udevadm%20hwdb%20%5Boptions%5D">¶</a></h3><p>Maintain the hardware database index in <code class="filename">/etc/udev/hwdb.bin</code>.</p><div class="variablelist"><dl class="variablelist"><dt id="--update"><span class="term"><code class="option">--update</code></span><a class="headerlink" title="Permalink to this term" href="#--update">¶</a></dt><dd><p>Compile the hardware database information located in /usr/lib/udev/hwdb.d/,
|
|
/etc/udev/hwdb.d/ and store it in <code class="filename">/etc/udev/hwdb.bin</code>. This should be done after
|
|
any update to the source files; it will not be called automatically. The running
|
|
udev daemon will detect a new database on its own and does not need to be
|
|
notified about it.</p></dd><dt id="--test=string"><span class="term"><code class="option">--test=<em class="replaceable"><code>string</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--test=string">¶</a></dt><dd><p>Query the database with a modalias string, and print the
|
|
retrieved properties.</p></dd><dt id="--root=string"><span class="term"><code class="option">--root=<em class="replaceable"><code>string</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--root=string">¶</a></dt><dd><p>Alternative root path in the filesystem for reading and writing files.</p></dd></dl></div></div><div class="refsect2"><a name="idm274702063648"></a><h3 id="udevadm test [options] devpath">udevadm test [<span class="optional">options</span>] <em class="replaceable"><code>devpath</code></em><a class="headerlink" title="Permalink to this headline" href="#udevadm%20test%20%5Boptions%5D%20devpath">¶</a></h3><p>Simulate a udev event run for the given device, and print debug output.</p><div class="variablelist"><dl class="variablelist"><dt id="--action=string"><span class="term"><code class="option">--action=<em class="replaceable"><code>string</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--action=string">¶</a></dt><dd><p>The action string.</p></dd><dt id="--subsystem=string"><span class="term"><code class="option">--subsystem=<em class="replaceable"><code>string</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--subsystem=string">¶</a></dt><dd><p>The subsystem string.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help">¶</a></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2"><a name="idm274702055744"></a><h3 id="udevadm test-builtin [options] command devpath">udevadm test-builtin [<span class="optional">options</span>] <em class="replaceable"><code>command</code></em> <em class="replaceable"><code>devpath</code></em><a class="headerlink" title="Permalink to this headline" href="#udevadm%20test-builtin%20%5Boptions%5D%20command%20devpath">¶</a></h3><p>Run a built-in command for the given device, and print debug output.</p><div class="variablelist"><dl class="variablelist"><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help">¶</a></dt><dd><p>Print help text.</p></dd></dl></div></div></div><div class="refsect1"><a name="idm274702051328"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p><a href="udev.html"><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span></a>
|
|
<a href="systemd-udevd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-udevd.service</span>(8)</span></a></p></div></div></body></html>
|