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§

CpuScheduling
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.
FinishedRun
A transient service finished.
Identity
The identity for running a transient service on the system service manager.
InputSpec
The description of a input.
Mount
The description of a mount.
OutputSpec
The description of a output.
ProtectProc
Controls the hidepid= mount option of the procfs instance in the private namespace of the unit.
RunSystem
Information of a transient service for running on the system service manager.
RunUser
Information of a transient service for running on the per-user service manager.
StartedRun
A transient service running.

Enums§

Error
The error type of systemd_run.

Type Aliases§

Result
Alias for a Result with the error type Error.