Descriptionsystemd-run may be used to create and
- start a transient .service or a transient
- .timer or a .scope unit
- and run the specified COMMAND in
- it.
+ start a transient .service or
+ .scope unit and run the specified
+ COMMAND in it. It may also be used to
+ create and start transient .timer
+ units.
If a command is run as transient service unit, it will be
started and managed by the service manager like any other service,
- and thus show up in the output of systemctl
+ and thus shows up in the output of systemctl
list-units like any other unit. It will run in a clean
- and detached execution environment. systemd-run
- will start the service asynchronously in the background and
- immediately return.
-
- If a command is run with timer options, transient timer unit
- also be created with transient service unit. But the transient
- timer unit is only started immediately. The transient service unit
- will be started when the transient timer is elapsed. If
- is specified with timer options, the
- COMMAND can be omitted. In this case,
- systemd-run assumes service unit is already
- loaded and creates transient timer unit only. To successfully
- create timer unit, already loaded service unit should be specified
- with . This transient timer unit can
- activate the existing service unit like any other timer.
+ and detached execution environment, with the service manager as
+ its parent process. In this mode systemd-run
+ will start the service asynchronously in the background and return
+ after the command has begun execution.
If a command is run as transient scope unit, it will be
- started directly by systemd-run and thus
- inherit the execution environment of the caller. It is however
- managed by the service manager similar to normal services, and
- will also show up in the output of systemctl
- list-units. Execution in this case is synchronous, and
- execution will return only when the command finishes.
+ started by systemd-run itself as parent process
+ and will thus inherit the execution environment of the
+ caller. However, the processes of the command are managed by the
+ service manager similar to normal services, and will show up in
+ the output of systemctl list-units. Execution
+ in this case is synchronous, and will return only when the command
+ finishes. This mode is enabled via the
+ switch (see below).
+
+ If a command is run with timer options such as
+ (see below), a transient timer
+ unit is created alongside the service unit for the specified
+ command. Only the transient timer unit is started immediately, the
+ transient service unit will be started when the transient timer
+ elapses. If the is specified, the
+ COMMAND may be omitted. In this case,
+ systemd-run only creates a
+ .timer unit that invokes the specified unit
+ when elapsing.