#systemd #service #running #processes #manager #transient #per-user

systemd-run

A Rust crate for running processes as Systemd transient services

8 releases (breaking)

0.7.1 Feb 22, 2024
0.6.0 Dec 1, 2023
0.5.0 Nov 27, 2023
0.4.0 Jan 29, 2023
0.2.0 Jul 14, 2022

#257 in Unix APIs

Download history 7/week @ 2024-01-26 114/week @ 2024-02-16 109/week @ 2024-02-23 22/week @ 2024-03-01 31/week @ 2024-03-08 8/week @ 2024-03-15 9/week @ 2024-03-29 86/week @ 2024-04-05

110 downloads per month

MIT/Apache

70KB
1.5K SLoC

Rust 1K SLoC // 0.0% comments C 136 SLoC // 0.1% comments C++ 37 SLoC

Contains (ELF exe/lib, 18KB) test-aux/setuid

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(())
}

Dependencies

~12–24MB
~356K SLoC