Forrest logo
tool overview
On this page you find all important commands for the CLI tool systemd-run. If the command you are looking for is missing please ask our AI.

systemd-run

systemd-run is a command line tool used in Linux systems that allows users to run transient systemd units from the command line. These transient units are temporary and exist only as long as the command is executed or until termination.

The tool provides an interface for creating on-the-fly systemd units without the need for manually creating unit files. It is especially useful for running short-lived tasks or one-time operations.

With systemd-run, users can specify various options and parameters to customize the execution environment. These options include setting the execution time limit, determining standard input/output behavior, managing resource constraints, and configuring the environment variables.

This command line tool ensures that the transient units are properly logged, managed, and integrated into the systemd ecosystem, providing a consistent and reliable execution environment.

It is particularly beneficial for automation, scripting, and administrative tasks where the creation and management of temporary units are required.

systemd-run simplifies the process of running commands in a controlled environment, allowing users to execute tasks efficiently and securely within the Linux system.

List of commands for systemd-run:

  • systemd-run:tldr:117fa systemd-run: Start a transient service with a custom unit name and description.
    $ sudo systemd-run --unit=${name} --description=${string} ${command} ${argument1 argument2 ---}
    try on your machine
    explain this command
  • systemd-run:tldr:19d09 systemd-run: 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 ${command}
    try on your machine
    explain this command
  • systemd-run:tldr:30089 systemd-run: 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 ---}
    try on your machine
    explain this command
  • systemd-run:tldr:44feb systemd-run: Start a transient service that does not get cleaned up after it terminates with a custom environment variable.
    $ sudo systemd-run --remain-after-exit --set-env=${name}=${value} ${command} ${argument1 argument2 ---}
    try on your machine
    explain this command
  • systemd-run:tldr:55b74 systemd-run: Start a transient service under the service manager of the current user (no privileges).
    $ systemd-run --user ${command} ${argument1 argument2 ---}
    try on your machine
    explain this command
  • systemd-run:tldr:7a673 systemd-run: 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 ${command}
    try on your machine
    explain this command
  • systemd-run:tldr:cfa8d systemd-run: Start a transient service.
    $ sudo systemd-run ${command} ${argument1 argument2 ---}
    try on your machine
    explain this command
tool overview