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
This commit is contained in:
Claude 2026-03-24 12:32:45 +00:00
parent 88f6e02d4e
commit 852e3f6ccb
No known key found for this signature in database
2 changed files with 17 additions and 0 deletions

View file

@ -56,4 +56,13 @@ fi
# ── Bring up the stack ───────────────────────────────────────────────────────── # ── Bring up the stack ─────────────────────────────────────────────────────────
podman system migrate podman system migrate
podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" up -d 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." echo "[hiy] Stack is up."

View file

@ -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" down
podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" up -d 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 ─────────────────────── # ── Install systemd user service for auto-start on boot ───────────────────────
# Uses a user-level (rootless) service so Podman's UID namespace is preserved. # 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. # loginctl enable-linger lets the service start even without an active login.