systemd: Add new module for interacting with systemd

This commit is contained in:
Vicki Pfau 2024-03-29 17:58:11 -07:00
parent 9ec6fc8852
commit 853ce3dd84
5 changed files with 123 additions and 40 deletions

View file

@ -10,8 +10,6 @@ use std::ffi::OsStr;
use tokio::process::Command;
use tracing::warn;
pub const SYSTEMCTL_PATH: &str = "/usr/bin/systemctl";
pub async fn script_exit_code(executable: &str, args: &[impl AsRef<OsStr>]) -> Result<i32> {
// Run given script and return the exit code
let mut child = Command::new(executable).args(args).spawn()?;