From: Zbigniew Jędrzejewski-Szmek Date: Thu, 16 Jul 2020 12:56:16 +0000 (+0200) Subject: man: add more details for IMPORT, PROGRAM and RUN keys X-Git-Tag: v246-rc2~53^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12254ccab0b7c1af02d07bb216edf81ac3a2aba4;p=thirdparty%2Fsystemd.git 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. --- diff --git a/man/udev.xml b/man/udev.xml index 9b97ee63d91..350ebcf5a2d 100644 --- a/man/udev.xml +++ b/man/udev.xml @@ -280,13 +280,17 @@ PROGRAM - 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 RESULT key. - This can only be used for very short-running foreground tasks. For details, - see RUN. + 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 RESULT + key. + + This can only be used for very short-running foreground tasks. For details, see + RUN. + + Note that multiple PROGRAM keys may be specified in one rule, and + =, :=, and += have the same effect as + ==. @@ -429,9 +433,14 @@ RUN{type} - Add a program to the list of programs to be executed after - processing all the rules for a specific event, depending on - type: + Specify a program to be executed after processing of all the rules for the event. With + +=, this invocation is added to the list, and with = or + :=, it replaces any previous contents of the list. Please note that both + program and builtin types described below use a single + list, so clearing the list with := and = affects both + types. + + type may be: program @@ -452,21 +461,21 @@ - The program name and following arguments are separated by spaces. - Single quotes can be used to specify arguments with spaces. - 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. - 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. - 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 systemd-udevd.service. - Please also note that := and = are clearing - both, program and builtin commands. - In order to activate long-running processes from udev rules, provide a service unit, and - pull it in from a udev device using the SYSTEMD_WANTS device property. See + + The program name and following arguments are separated by spaces. Single quotes can be + used to specify arguments with spaces. + + 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. + + 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 + systemd-udevd.service. + + 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 SYSTEMD_WANTS device property. See systemd.device5 for details. @@ -489,8 +498,9 @@ IMPORT{type} - Import a set of variables as device properties, - depending on type: + Import a set of variables as device properties, depending on + type: + program @@ -542,8 +552,14 @@ - This can only be used for very short-running foreground tasks. For details - see . + + This can only be used for very short-running foreground tasks. For details see + . + + Note that multiple IMPORT{} keys may be specified in one rule, and + =, :=, and += have the same effect as + ==. The key is true if the import is successful, unless != + is used as the operator which causes the key to be true if the import failed. @@ -633,9 +649,8 @@ , - The kernel number for this device. For example, - sda3 has kernel number 3. - + The kernel number for this device. For example, sda3 has kernel number + 3.