diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-07-16 14:56:16 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-07-16 18:38:03 +0200 |
commit | 12254ccab0b7c1af02d07bb216edf81ac3a2aba4 (patch) | |
tree | 468fb31980f4afe12e3965255af68756961c2e1b /man/udev.xml | |
parent | ba60127df7bcc8263ae94092aca972b9f11c70ec (diff) | |
download | systemd-12254ccab0b7c1af02d07bb216edf81ac3a2aba4.tar.gz |
man: add more details for IMPORT, PROGRAM and RUN keys
967de8faceaa83c11a1215515cb135d7a8c0c32c added a note that I found very hard
to understand. Reword it, and also describe how IMPORT and PROGRAM are different
from RUN.
Minor markup adjustements too.
Diffstat (limited to 'man/udev.xml')
-rw-r--r-- | man/udev.xml | 79 |
1 files changed, 47 insertions, 32 deletions
diff --git a/man/udev.xml b/man/udev.xml index 9b97ee63d9..350ebcf5a2 100644 --- a/man/udev.xml +++ b/man/udev.xml @@ -280,13 +280,17 @@ <varlistentry> <term><varname>PROGRAM</varname></term> <listitem> - <para>Execute a program to determine whether there - is a match; the key is true if the program returns - successfully. The device properties are made available to the - executed program in the environment. The program's standard output - is available in the <varname>RESULT</varname> key.</para> - <para>This can only be used for very short-running foreground tasks. For details, - see <varname>RUN</varname>.</para> + <para>Execute a program to determine whether there is a match; the key is true if the program + returns successfully. The device properties are made available to the executed program in the + environment. The program's standard output is available in the <varname>RESULT</varname> + key.</para> + + <para>This can only be used for very short-running foreground tasks. For details, see + <varname>RUN</varname>.</para> + + <para>Note that multiple <varname>PROGRAM</varname> keys may be specified in one rule, and + <literal>=</literal>, <literal>:=</literal>, and <literal>+=</literal> have the same effect as + <literal>==</literal>.</para> </listitem> </varlistentry> @@ -429,9 +433,14 @@ <varlistentry> <term><varname>RUN{<replaceable>type</replaceable>}</varname></term> <listitem> - <para>Add a program to the list of programs to be executed after - processing all the rules for a specific event, depending on - <literal>type</literal>:</para> + <para>Specify a program to be executed after processing of all the rules for the event. With + <literal>+=</literal>, this invocation is added to the list, and with <literal>=</literal> or + <literal>:=</literal>, it replaces any previous contents of the list. Please note that both + <literal>program</literal> and <literal>builtin</literal> types described below use a single + list, so clearing the list with <literal>:=</literal> and <literal>=</literal> affects both + types.</para> + + <para><replaceable>type</replaceable> may be:</para> <variablelist> <varlistentry> <term><literal>program</literal></term> @@ -452,21 +461,21 @@ </listitem> </varlistentry> </variablelist> - <para>The program name and following arguments are separated by spaces. - Single quotes can be used to specify arguments with spaces.</para> - <para>This can only be used for very short-running foreground tasks. Running an - event process for a long period of time may block all further events for - this or a dependent device.</para> - <para>Starting daemons or other long-running processes is not appropriate - for udev; the forked processes, detached or not, will be unconditionally - killed after the event handling has finished.</para> - <para>Note that running programs that access the network or mount/unmount - filesystems is not allowed inside of udev rules, due to the default sandbox - that is enforced on <filename>systemd-udevd.service</filename>.</para> - <para>Please also note that <literal>:=</literal> and <literal>=</literal> are clearing - both, program and builtin commands.</para> - <para>In order to activate long-running processes from udev rules, provide a service unit, and - pull it in from a udev device using the <varname>SYSTEMD_WANTS</varname> device property. See + + <para>The program name and following arguments are separated by spaces. Single quotes can be + used to specify arguments with spaces.</para> + + <para>This can only be used for very short-running foreground tasks. Running an event process for + a long period of time may block all further events for this or a dependent device.</para> + + <para>Note that running programs that access the network or mount/unmount filesystems is not + allowed inside of udev rules, due to the default sandbox that is enforced on + <filename>systemd-udevd.service</filename>.</para> + + <para>Starting daemons or other long-running processes is not allowed; the forked processes, + detached or not, will be unconditionally killed after the event handling has finished. In order + to activate long-running processes from udev rules, provide a service unit and pull it in from a + udev device using the <varname>SYSTEMD_WANTS</varname> device property. See <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> for details.</para> </listitem> @@ -489,8 +498,9 @@ <varlistentry> <term><varname>IMPORT{<replaceable>type</replaceable>}</varname></term> <listitem> - <para>Import a set of variables as device properties, - depending on <literal>type</literal>:</para> + <para>Import a set of variables as device properties, depending on + <replaceable>type</replaceable>:</para> + <variablelist> <varlistentry> <term><literal>program</literal></term> @@ -542,8 +552,14 @@ </listitem> </varlistentry> </variablelist> - <para>This can only be used for very short-running foreground tasks. For details - see <option>RUN</option>.</para> + + <para>This can only be used for very short-running foreground tasks. For details see + <option>RUN</option>.</para> + + <para>Note that multiple <varname>IMPORT{}</varname> keys may be specified in one rule, and + <literal>=</literal>, <literal>:=</literal>, and <literal>+=</literal> have the same effect as + <literal>==</literal>. The key is true if the import is successful, unless <literal>!=</literal> + is used as the operator which causes the key to be true if the import failed.</para> </listitem> </varlistentry> @@ -633,9 +649,8 @@ <varlistentry> <term><option>$number</option>, <option>%n</option></term> <listitem> - <para>The kernel number for this device. For example, - <literal>sda3</literal> has kernel number <literal>3</literal>. - </para> + <para>The kernel number for this device. For example, <literal>sda3</literal> has kernel number + 3.</para> </listitem> </varlistentry> |