[pbs-devel] applied: [PATCH v2 backup 01/27] systemd: add reload_unit

Dietmar Maurer dietmar at proxmox.com
Wed Apr 28 12:15:47 CEST 2021


applied

On 4/22/21 4:01 PM, Wolfgang Bumiller wrote:
> via try-reload-or-restart
>
> Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
> ---
>   src/tools/systemd.rs | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/src/tools/systemd.rs b/src/tools/systemd.rs
> index f8ae789c..c1760781 100644
> --- a/src/tools/systemd.rs
> +++ b/src/tools/systemd.rs
> @@ -131,6 +131,17 @@ pub fn stop_unit(unit: &str) -> Result<(), Error> {
>       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]
>   fn test_escape_unit() -> Result<(), Error> {
>   





More information about the pbs-devel mailing list