systemd-run
Run programs in transient scope units, service units, or path-, socket-, or timer-triggered service units. More information: https://www.freedesktop.org/software/systemd/man/latest/systemd-run.html.
- Start a transient service:
sudo systemd-run
- Start a transient service under the service manager of the current user (no privileges):
systemd-run --user
- Start a transient service with a custom unit name and description:
sudo systemd-run --description
- Start a transient service that does not get cleaned up after it terminates with a custom environment variable:
sudo systemd-run --set-env==
- Start a transient timer that periodically runs its transient service (see
man systemd.timefor calendar event format):
sudo systemd-run --on-calendar=
- Share the terminal with the program (allowing interactive input/output) and make sure the execution details remain after the program exits:
systemd-run --pty
- Set properties (e.g. CPUQuota, MemoryMax) of the process and wait until it exits:
systemd-run MemoryMax= CPUQuota=% --wait
- Use the program in a shell pipeline:
| systemd-run |
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
