systemd-run:tldr:7a673
The command systemd-run
is a utility provided by the systemd
init system in Linux. It allows you to run a command as a transient service within the systemd manager.
Here's the breakdown of the command you provided:
systemd-run
: This is the main command that starts a new transient service with the specified properties.
--property MemoryMax=${memory_in_bytes}
: This flag sets the maximum memory limit for the service in bytes. ${memory_in_bytes}
should be replaced with the desired value.
--property CPUQuota=${percentage_of_CPU_time}%
: This flag sets the maximum CPU usage limit for the service as a percentage. ${percentage_of_CPU_time}
should be replaced with the desired percentage value.
--wait
: This flag makes the systemd-run
command wait for the command to finish before exiting, allowing you to see its output.
${command}
: This placeholder represents the actual command you want to run as a transient service. Replace ${command}
with the desired command.
So, when you execute this command, systemd-run
creates a new service with specified memory and CPU limits, runs the provided ${command}
within that service, and waits for the command to complete. The output of the command will be displayed, and then the systemd-run
command will exit.