From bfa15712577bf504a3b6a4afed01ebf1cde715d9 Mon Sep 17 00:00:00 2001 From: Mateusz Majewski Date: Fri, 21 Apr 2023 19:44:59 +0200 Subject: [PATCH] systemd-run: update page (#9911) * systemd-run: update page --------- Co-authored-by: K.B.Dharun Krishna Co-authored-by: Jack Lin Co-authored-by: Emily Grace Seville --- pages/linux/systemd-run.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pages/linux/systemd-run.md b/pages/linux/systemd-run.md index b74f7985e1..2faff670f7 100644 --- a/pages/linux/systemd-run.md +++ b/pages/linux/systemd-run.md @@ -1,7 +1,7 @@ # systemd-run -> Run programs in transient units. -> More information: . +> Run programs in transient scope units, service units, or path-, socket-, or timer-triggered service units. +> More information: . - Start a transient service: @@ -22,3 +22,15 @@ - Start a transient timer that periodically runs its transient service (see `man systemd.time` for calendar event format): `sudo systemd-run --on-calendar={{calendar_event}} {{command}} {{argument1 argument2 ...}}` + +- Share the terminal with the program (allowing interactive input/output) and make sure the execution details remain after the program exits: + +`systemd-run --remain-after-exit --pty {{executable}}` + +- Set properties (e.g. CPUQuota, MemoryMax) of the process and wait until it exits: + +`systemd-run --property MemoryMax={{memory_in_bytes}} --property CPUQuota={{percentage_of_CPU_time}}% --wait {{executable}}` + +- Use the program in a shell pipeline: + +`{{executable1}} | systemd-run --pipe {{executable2}} | {{executable3}}`