From 6fab0d7f1ae77a7f05e8dfea21ba6ff965dc2dd0 Mon Sep 17 00:00:00 2001 From: atlas Date: Thu, 4 Jun 2026 09:51:49 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20update=20gateway.md=20=E2=80=94=20nginx?= =?UTF-8?q?=20reload=20goes=20through=20hive-priv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reflect the fix from the companion Rust change: the nginx reload/start is now routed through hive-priv (root) instead of calling systemd-run --machine= directly from unprivileged hive-c0re. Document the state-aware dispatch (active→reload, failed→reset+start, other→start). --- docs/gateway.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/gateway.md b/docs/gateway.md index 54f56860..a0b16d63 100644 --- a/docs/gateway.md +++ b/docs/gateway.md @@ -97,11 +97,15 @@ now set unconditionally for every agent. The mechanism: that haven't yet been rebuilt under the new config. The gateway container bind-mounts `/var/lib/hyperhive/gateway/` at `/run/hive-state/`; nginx includes `/run/hive-state/agents.conf`. - After each write, c0re triggers `nginx -s reload` inside the - gateway container from the HOST via - `systemd-run --machine=hive-gateway --wait nginx -s reload`. This is - intentionally host-side: `IN_MOVED_TO` from an atomic rename does - not propagate across the nspawn mount-namespace boundary, so a + After each write, c0re triggers the appropriate nginx action inside + the gateway container via `hive-priv` (which runs as root and has + `--machine=hive-gateway` transport rights that hive-c0re lacks). + `hive-priv` queries `ActiveState` and dispatches: + - active → `systemctl reload nginx` (SIGHUP, zero-downtime) + - failed → `systemctl reset-failed nginx` + `systemctl start nginx` + - otherwise → `systemctl start nginx` + This is intentionally host-side: `IN_MOVED_TO` from an atomic rename + does not propagate across the nspawn mount-namespace boundary, so a path unit inside the container would never fire. c0re regenerates `agents.conf` (and triggers a reload) on two