diff --git a/hive-c0re/src/job_queue/exec.rs b/hive-c0re/src/job_queue/exec.rs index 93cb974f..9a229459 100644 --- a/hive-c0re/src/job_queue/exec.rs +++ b/hive-c0re/src/job_queue/exec.rs @@ -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/` + `/run/hive-agent/` + // (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");