rebuild re-registers agent; preserve /run/hyperhive across restarts

This commit is contained in:
müde 2026-05-14 22:13:00 +02:00
parent 746132d41e
commit af464e27f4
3 changed files with 5 additions and 1 deletions

View file

@ -26,6 +26,9 @@ impl Coordinator {
}
pub async fn register_agent(&self, name: &str) -> Result<PathBuf> {
// Idempotent: drop any existing listener so re-registration (e.g. on rebuild,
// or after a hive-c0re restart cleared /run/hyperhive) gets a fresh socket.
self.unregister_agent(name);
let agent_dir = Self::agent_dir(name);
std::fs::create_dir_all(&agent_dir)
.with_context(|| format!("create agent dir {}", agent_dir.display()))?;