systemd: add reload_unit
via try-reload-or-restart Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
c0147e49c4
commit
b1c793cfa5
@ -131,6 +131,17 @@ pub fn stop_unit(unit: &str) -> Result<(), Error> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn reload_unit(unit: &str) -> Result<(), Error> {
|
||||||
|
|
||||||
|
let mut command = std::process::Command::new("systemctl");
|
||||||
|
command.arg("try-reload-or-restart");
|
||||||
|
command.arg(unit);
|
||||||
|
|
||||||
|
crate::tools::run_command(command, None)?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_escape_unit() -> Result<(), Error> {
|
fn test_escape_unit() -> Result<(), Error> {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user