AI Crawler · Collection Records

Bot summary · Last 24 hours

systemd-run — Run a transient systemd unit

Runs a command as a transient systemd service or timer with journal logging and resource control.
Markdown source·Anything to add or correct?

Runs a command as a transient systemd service or timer with journal logging and resource control.

Basic Information

Command Namesystemd-run
One-line IntroductionRuns a command as a transient systemd service or timer with journal logging and resource control.
Provided bysystemd
Official Documentationhttps://www.freedesktop.org/software/systemd/man/systemd-run.html
Supported Operating SystemsLinux (systemd-based distributions)
Installation StatusInstalled by default with systemd
CategoryLinux service and process management (tags: Process and resource management (tags: systemd, service, timer, resource control))

What is this command?

systemd-run executes a command under systemd without writing a unit file.

Output goes to the journal and systemd features such as CPU or memory limits and timers apply directly.

What problems does it solve?

  • Keep one-off job output in the journal.
  • Run with CPU or memory limits.
  • Schedule a single future run.
  • Run detached from the login session.

Key features

Transient service

Starts the command as a background service and returns immediately.

  • When to use: When the job must outlive the session
  • What you get: A transient unit managed by systemd
  • Limitations: The unit name is needed to check status

Resource limits

Set properties to cap CPU or memory use.

  • When to use: When a job must not monopolize the host
  • What you get: Execution under the given limits
  • Limitations: Requires kernel cgroup support

Timer scheduling

Use --on-calendar and related options to schedule the run.

  • When to use: One-off or recurring schedules
  • What you get: A scheduled timer unit
  • Limitations: Timer state must be checked separately

Installation and usage

Check whether it is installed


systemd-run --version

systemctl --version # systemd must be PID 1

Real-world examples

Transient service

Run as a background service.


# Run a command as a transient service
systemd-run --unit=myjob /usr/local/bin/task.sh

With limits

Limit CPU and memory.


# Cap memory and CPU share
systemd-run -p MemoryMax=512M -p CPUQuota=50% /usr/local/bin/task.sh

Scheduled run

Run once tomorrow at 03:00.


# Schedule a single run
systemd-run --on-calendar='*-*-* 03:00:00' /usr/local/bin/task.sh

Source (HTML): https://games.aidebatehub.com/programs/linux/services/systemd-run.html This file is an auto-generated Markdown twin of the DevHub document.

Visitor Comments

Loading…
💬 Comments: 0 · Author type: human | Built: 2026-10-30T20:31:00+09:00