Add wrapper error on podman start failure

Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
Chris Evich
2022-11-18 09:03:29 -05:00
parent b4dd3c667c
commit e5dfadbd4c

View File

@@ -11,11 +11,18 @@ if [[ -n "$PODMAN_RUNNER_DEBUG" ]]; then
_debug_args="--log-level=$PODMAN_RUNNER_DEBUG" _debug_args="--log-level=$PODMAN_RUNNER_DEBUG"
fi fi
if [[ "$1" == "run" ]] && [[ ! -S "/tmp/podman-run-1000/podman/podman.sock" ]]; then SOCKET="/tmp/podman-run-1000/podman/podman.sock"
if [[ "$1" == "run" ]] && [[ ! -S "$SOCKET" ]]; then
podman $_debug_args system service -t 0 & podman $_debug_args system service -t 0 &
/usr/local/bin/podman-in-podman-maintenance & /usr/local/bin/podman-in-podman-maintenance &
# Prevent SIGHUP propagation to podman process # Prevent SIGHUP propagation to podman process
disown -ar disown -ar
sleep 1s # Give podman a chance to get going
# Verify podman is listening on it's socket
if [[ ! -S "$SOCKET" ]]; then
echo "ERROR: Inner-podman system service failed to start, expecting to find socket '$SOCKET'. Are all volume's owned & writeable by $(id -u podman):$(id -g podman)?" > /dev/stderr
exit 1
fi
fi fi
exec gitlab-runner "$@" exec gitlab-runner "$@"