Crate systemd_run

source ·
Expand description

§systemd_run

This is the crate for running processes as Systemd transient services.

Status: Highly unstable, at early development cycle.

§Example code

This code starts /bin/true as a Systemd transient service, running in the per-user service manager of your login session, and wait for it to finish.

#[async_std::main]
async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
	let status = systemd_run::RunUser::new("/bin/true")
		.start()
		.await?
		.wait()
		.await?;
	dbg!(status);
	Ok(())
}

Structs§

  • The CPU scheduling for running a transient service on the system service manager. See CPUSchedulingPolicy=, CPUSchedulingPriority=, and CPUSchedulingResetOnFork= in systemd.exec(5) and sched_setscheduler(2) for details.
  • A transient service finished.
  • The identity for running a transient service on the system service manager.
  • The description of a input.
  • The description of a mount.
  • The description of a output.
  • Controls the hidepid= mount option of the procfs instance in the private namespace of the unit.
  • Information of a transient service for running on the system service manager.
  • Information of a transient service for running on the per-user service manager.
  • A transient service running.

Enums§

  • The error type of systemd_run.

Type Aliases§