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=
, andCPUSchedulingResetOnFork=
in systemd.exec(5) and sched_setscheduler(2) for details. - Finished
Run - A transient service finished.
- Identity
- The identity for running a transient service on the system service manager.
- Input
Spec - The description of a input.
- Mount
- The description of a mount.
- Output
Spec - The description of a output.
- Protect
Proc - Controls the
hidepid=
mount option of theprocfs
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.
- Started
Run - A transient service running.
Enums§
- Error
- The error type of
systemd_run
.