mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
add quick documentation suggesting systemd-run --scope if using cmd.run_bg with systemd
This commit is contained in:
parent
5d82df5667
commit
4b11f8d66d
1 changed files with 6 additions and 0 deletions
|
@ -3127,6 +3127,12 @@ def run_bg(cmd,
|
|||
Note that ``env`` represents the environment variables for the command, and
|
||||
should be formatted as a dict, or a YAML string which resolves to a dict.
|
||||
|
||||
.. note::
|
||||
|
||||
If the init system is systemd and the backgrounded task should run even if the salt-minion process
|
||||
is restarted, prepend ``systemd-run --scope`` to the command. This will reparent the process in its
|
||||
own scope separate from salt-minion, and will not be affected by restarting the minion service.
|
||||
|
||||
:param str cmd: The command to run. ex: 'ls -lart /home'
|
||||
|
||||
:param str cwd: The current working directory to execute the command in.
|
||||
|
|
Loading…
Add table
Reference in a new issue