fix(#2003): start root container if present-but-stopped on hive-c0re boot
This commit is contained in:
parent
ad8ed452fd
commit
2cd089b65f
1 changed files with 14 additions and 0 deletions
|
|
@ -195,6 +195,20 @@ pub async fn ensure_root_agent(coord: &Arc<Coordinator>) -> Result<()> {
|
||||||
} else {
|
} else {
|
||||||
tracing::debug!("manager container already present");
|
tracing::debug!("manager container already present");
|
||||||
}
|
}
|
||||||
|
// The root/manager is required infrastructure — it must be running
|
||||||
|
// after every hive-c0re (re)start. A previous bring-up can leave it
|
||||||
|
// *created but stopped* (e.g. a first-start failure on a fresh
|
||||||
|
// install, #2003): the startup sweep's rebuild only restarts a
|
||||||
|
// container that was already running, so without this it stays down
|
||||||
|
// until a manual `nixos-container start`. Unlike sub-agents there is
|
||||||
|
// no "deliberately stopped root" intent to honour, so start it
|
||||||
|
// unconditionally when it isn't running.
|
||||||
|
if !lifecycle::is_running(MANAGER_NAME).await {
|
||||||
|
tracing::info!("manager container present but not running — starting");
|
||||||
|
if let Err(e) = lifecycle::start(MANAGER_NAME).await {
|
||||||
|
tracing::warn!(error = ?e, "manager start failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
tracing::info!("manager container missing — spawning");
|
tracing::info!("manager container missing — spawning");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue