Crates.io | systemd-run |
lib.rs | systemd-run |
version | 0.9.0 |
source | src |
created_at | 2022-07-13 08:50:28.317359 |
updated_at | 2024-11-06 11:08:33.314026 |
description | A Rust crate for running processes as Systemd transient services. |
homepage | |
repository | https://github.com/xdu-icpc/rust-systemd-run |
max_upload_size | |
id | 624941 |
size | 118,851 |
This is the crate for running processes as Systemd transient services.
Status: Highly unstable, at early development cycle.
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(())
}