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
This commit is contained in:
parent
06ababa7c6
commit
5359c43cb8
1 changed files with 13 additions and 4 deletions
|
|
@ -60,13 +60,22 @@ EOF
|
||||||
echo "[hiy] Generated proxy/caddy.json for ${DOMAIN_SUFFIX}"
|
echo "[hiy] Generated proxy/caddy.json for ${DOMAIN_SUFFIX}"
|
||||||
|
|
||||||
# ── Ensure Podman socket is active ────────────────────────────────────────────
|
# ── 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"
|
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 PODMAN_SOCK
|
||||||
export DOCKER_HOST="unix://${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 ───────────────────────────────────────────────────────────────
|
# ── Build images ───────────────────────────────────────────────────────────────
|
||||||
make build
|
make build
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue