From 852e3f6ccbc369451bdb0b39dd42e3c7facf7c8b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Mar 2026 12:32:45 +0000 Subject: [PATCH] fix: restart deployed app containers after platform start podman system migrate explicitly stops all containers, which overrides the --restart unless-stopped policy set on deployed apps. After compose up-d brings the infra stack back, any exited hiy-* container is now restarted automatically. Same logic added to boot.sh for the on-boot path. https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH --- infra/boot.sh | 9 +++++++++ infra/start.sh | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/infra/boot.sh b/infra/boot.sh index 350119e..ebe416d 100755 --- a/infra/boot.sh +++ b/infra/boot.sh @@ -56,4 +56,13 @@ fi # ── Bring up the stack ───────────────────────────────────────────────────────── podman system migrate podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" up -d + +# ── Restart deployed app containers ─────────────────────────────────────────── +podman ps -a --filter "status=exited" --format "{{.Names}}" \ + | grep '^hiy-' \ + | while IFS= read -r name; do + echo "[hiy] Restarting app: $name" + podman start "$name" || true + done + echo "[hiy] Stack is up." diff --git a/infra/start.sh b/infra/start.sh index 933d619..065cdd8 100755 --- a/infra/start.sh +++ b/infra/start.sh @@ -187,6 +187,14 @@ podman system migrate podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" down podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" up -d +# ── Restart deployed app containers (stopped by podman system migrate above) ─── +podman ps -a --filter "status=exited" --format "{{.Names}}" \ + | grep '^hiy-' \ + | while IFS= read -r name; do + echo "[hiy] Restarting app: $name" + podman start "$name" || true + done + # ── Install systemd user service for auto-start on boot ─────────────────────── # Uses a user-level (rootless) service so Podman's UID namespace is preserved. # loginctl enable-linger lets the service start even without an active login.