Debian Codegraph @

doc/config/task-and-run.md

raw symbols SCIP
1 run (sequence)
2 --------------
3
4 **Syntax:** `run [LVLS] <COND> /path/to/cmd ARGS -- Optional description`
5
6 > `<COND>` is described in the [Services](services.md) section.
7
8 One-shot command to run in sequence when entering a runlevel, with
9 optional arguments and description. `run` commands are guaranteed to be
10 completed before running the next command. Useful when serialization is
11 required.
12
13 > [!WARNING]
14 > Try to avoid the `run` command. It blocks much of the functionality
15 > in Finit, like (re)starting other (perhaps crashing) services while a
16 > `run` task is executing. Use other synchronization mechanisms
17 > instead, like conditions.
18
19 Incomplete list of unsupported `initctl` commands in `run` tasks:
20
21 - `initctl runlevel N`, setting runlevel
22 - `initctl reboot`
23 - `initctl halt`
24 - `initctl poweroff`
25 - `initctl suspend`
26
27 To prevent `initctl` from calling Finit when enabling and disabling
28 services from inside a `run` task, use the `--force` option. See
29 also the `--quiet` and `--batch` options.
30
31 task (parallel)
32 ---------------
33
34 **Syntax:** `task [LVLS] <COND> /path/to/cmd ARGS -- Optional description`
35
36 > `<COND>` is described in the [Services](services.md) section.
37
38 One-shot like 'run', but starts in parallel with the next command.
39
40 Both `run` and `task` commands are run in a shell, so basic pipes and
41 redirects can be used:
42
43 task [s] echo "foo" | cat >/tmp/bar
44
45 Please note, `;`, `&&`, `||`, and similar are *not supported*. Any
46 non-trivial constructs are better placed in a separate shell script.