fix(hive-c0re): converge /run bind sources + limits drop-in before reconcile-start

This commit is contained in:
müde 2026-07-08 21:48:37 +02:00
commit c7c156e57b

View file

@ -245,6 +245,19 @@ async fn run_reconcile(
.transient
.is_none()
.then(|| coord.transient_guard(name, crate::coordinator::TransientKind::Starting));
// Converge the ephemeral host-side state before the start:
// `/run/hyperhive/agents/<name>` + `/run/hive-agent/<name>`
// (both nspawn bind sources — tmpfs, empty after a host
// reboot; nspawn refuses to start with a missing source)
// and the resource-limits drop-in under
// `/run/systemd/system/`. Rebuild DAGs get this from their
// Prebuild/Swap nodes; the bare-Reconcile templates (boot
// reconcile, plain start/restart) otherwise start with
// nothing under /run and fail.
let agent_dir = coord.ensure_runtime(name)?;
let hive = coord.hive_env();
let paths = Coordinator::agent_paths(name, agent_dir);
crate::lifecycle::write_dropins(name, &hive, &paths).await?;
ctx.step("nixos-container start");
crate::lifecycle::start_with_fallback(name).await?;
coord.kick_agent(name, "container started");