The one-node bed supervises the host as a service, so reboot is a real check

Installs the shipped nox-mesh-host launcher and unit in the machine and lets the
installer's --host-service start and enable it, instead of --host-in-background
which cannot survive a reboot. E2 now proves the mesh comes back on its own.

Claude-Session: https://claude.ai/code/session_01D6qtiYU3P9jk3pnAXyAFyx
This commit is contained in:
2026-09-16 16:20:44 +02:00
parent f57e05e75e
commit 49b80d8516
3 changed files with 46 additions and 4 deletions
+23
View File
@@ -626,3 +626,26 @@ export async function loadHeldImages(
return held;
}
/**
* Install the host's systemd packaging, so the installer supervises it as a service rather than a
* background process — the path a real machine takes, and the only one that survives a reboot. The
* lab places the binary at HOST_PATH; the shipped launcher runs $MESH_HOST_BIN (default
* /usr/bin/nox-mesh-host), so a symlink points that at the binary rather than editing the packaged
* unit. The installer's --host-service then starts AND enables it (novox/hq ADR 0005).
*/
export async function installHostService(
instanceName: string,
machine: string,
packagingDir: string,
logMessage: (message: string) => void = () => {},
): Promise<void> {
const launcher = join(packagingDir, "nox-mesh-host-launch");
const unit = join(packagingDir, "nox-mesh-host.service");
await incus(["exec", instanceName, "--", "mkdir", "-p", "/usr/lib/nox-mesh-host"], 60_000);
await incus(["file", "push", launcher, `${instanceName}/usr/lib/nox-mesh-host/launch`, "--mode", "0755"], 120_000);
await incus(["file", "push", unit, `${instanceName}/etc/systemd/system/nox-mesh-host.service`, "--mode", "0644"], 120_000);
await incus(["exec", instanceName, "--", "ln", "-sf", HOST_PATH, "/usr/bin/nox-mesh-host"], 60_000);
await incus(["exec", instanceName, "--", "systemctl", "daemon-reload"], 60_000);
logMessage(`installed nox-mesh-host.service on ${machine}`);
}