diff --git a/core/archipelago/src/main.rs b/core/archipelago/src/main.rs index c49e72eb..4e2d093d 100644 --- a/core/archipelago/src/main.rs +++ b/core/archipelago/src/main.rs @@ -206,6 +206,27 @@ async fn main() -> Result<()> { tracing::error!(error = %e, "prod orchestrator: load_manifests failed at startup"); } } + // Reboot-survival safety net for the podman `--restart` path: ensure the + // user's podman-restart.service is enabled so `unless-stopped` containers + // come back after a reboot even when the Quadlet backend path is off + // (orchestrator-installed backends like immich/btcpay run as plain podman + // containers until the Phase-3 Quadlet rollout). Idempotent + best-effort. + { + let out = tokio::process::Command::new("systemctl") + .args(["--user", "enable", "--now", "podman-restart.service"]) + .output() + .await; + match out { + Ok(o) if o.status.success() => { + info!("🔁 podman-restart.service enabled (reboot-survival for --restart containers)") + } + Ok(o) => tracing::debug!( + "podman-restart.service enable skipped: {}", + String::from_utf8_lossy(&o.stderr).trim() + ), + Err(e) => tracing::debug!("podman-restart.service enable skipped: {e}"), + } + } // Adoption pass: link existing podman containers back to their // manifests so the reconciler doesn't recreate them. match tokio::time::timeout(Duration::from_secs(35), prod.adopt_existing()).await {