From efedfc3ea6ad791a18764f0ec0b8714c81a2a50d Mon Sep 17 00:00:00 2001 From: damocles Date: Mon, 1 Jun 2026 16:47:28 +0200 Subject: [PATCH] fix(702): narrow SystemdRunMachine to ReloadGatewayNginx in hive-priv --- hive-priv/src/main.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/hive-priv/src/main.rs b/hive-priv/src/main.rs index c86be801..23d18c80 100644 --- a/hive-priv/src/main.rs +++ b/hive-priv/src/main.rs @@ -243,25 +243,20 @@ async fn exec(req: PrivRequest) -> Result<(String, String)> { Ok((String::new(), String::new())) } - PrivRequest::SystemdRunMachine { ref machine, ref cmd } => { - validate_container_name(machine)?; - let mut args = vec!["--machine".to_owned(), machine.clone(), "--quiet".to_owned(), "--".to_owned()]; - args.extend(cmd.iter().cloned()); + PrivRequest::ReloadGatewayNginx => { let out = Command::new("systemd-run") - .args(&args) + .args(["--machine=hive-gateway", "--quiet", "--", "nginx", "-s", "reload"]) .output() .await - .context("invoke systemd-run")?; - let stdout = String::from_utf8_lossy(&out.stdout).into_owned(); - let stderr = String::from_utf8_lossy(&out.stderr).into_owned(); + .context("invoke systemd-run for gateway nginx reload")?; if !out.status.success() { bail!( - "systemd-run --machine={machine} failed ({}): {}", + "gateway nginx reload failed ({}): {}", out.status, - stderr.trim() + String::from_utf8_lossy(&out.stderr).trim() ); } - Ok((stdout, stderr)) + Ok((String::new(), String::new())) } } }