Merge pull request #44725 from whytewolf/1919_cmd.run_no_daemons

document note suggesting systemd-run --scope with cmd.run_bg
This commit is contained in:
Mike Place 2017-11-30 12:18:05 -07:00 committed by GitHub
commit 20391c54c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.