From 5359c43cb809c1a794bff3c2161ba04513ded61e Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Mar 2026 07:37:02 +0000 Subject: [PATCH] Replace systemctl --user with podman system service for socket activation systemctl --user fails in non-interactive shells (no D-Bus session bus). podman system service starts the socket directly without systemd/D-Bus, backgrounding the process and waiting up to 5 s for the socket to appear. https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH --- infra/start.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/infra/start.sh b/infra/start.sh index ea3d86f..3d25713 100755 --- a/infra/start.sh +++ b/infra/start.sh @@ -60,13 +60,22 @@ EOF echo "[hiy] Generated proxy/caddy.json for ${DOMAIN_SUFFIX}" # ── Ensure Podman socket is active ──────────────────────────────────────────── +# systemctl --user requires a D-Bus session (not available in non-interactive +# shells). Use podman system service directly instead. PODMAN_SOCK="/run/user/$(id -u)/podman/podman.sock" -if [ ! -S "$PODMAN_SOCK" ]; then - echo "[hiy] Starting Podman socket…" - systemctl --user start podman.socket -fi export PODMAN_SOCK export DOCKER_HOST="unix://${PODMAN_SOCK}" +if [ ! -S "$PODMAN_SOCK" ]; then + echo "[hiy] Starting Podman socket via podman system service…" + mkdir -p "$(dirname "$PODMAN_SOCK")" + podman system service --time=0 "unix://${PODMAN_SOCK}" & + # Wait up to 5 s for the socket to appear + for i in 1 2 3 4 5; do + [ -S "$PODMAN_SOCK" ] && break + sleep 1 + done + [ -S "$PODMAN_SOCK" ] || { echo "ERROR: Podman socket did not appear"; exit 1; } +fi # ── Build images ─────────────────────────────────────────────────────────────── make build