diff --git a/scripts/run-openclaw-podman.sh b/scripts/run-openclaw-podman.sh index bfc96daa94ad..375d59e42008 100755 --- a/scripts/run-openclaw-podman.sh +++ b/scripts/run-openclaw-podman.sh @@ -38,7 +38,11 @@ fail() { run_podman_detached() { if command -v timeout >/dev/null 2>&1; then - timeout "$PODMAN_RUN_TIMEOUT" podman run "$@" + if timeout --kill-after=1s 1s true >/dev/null 2>&1; then + timeout --kill-after=30s "$PODMAN_RUN_TIMEOUT" podman run "$@" + else + timeout "$PODMAN_RUN_TIMEOUT" podman run "$@" + fi return fi podman run "$@" diff --git a/test/scripts/test-install-sh-docker.test.ts b/test/scripts/test-install-sh-docker.test.ts index 1358b52a8dbd..f0e2f4f4dc3e 100644 --- a/test/scripts/test-install-sh-docker.test.ts +++ b/test/scripts/test-install-sh-docker.test.ts @@ -153,6 +153,8 @@ describe("test-install-sh-docker", () => { expect(script).toContain('PODMAN_RUN_TIMEOUT="${OPENCLAW_PODMAN_RUN_TIMEOUT:-600s}"'); expect(script).toContain("OPENCLAW_PODMAN_RUN_TIMEOUT|OPENCLAW_PODMAN_GATEWAY_HOST_PORT"); expect(script).toContain("run_podman_detached()"); + expect(script).toContain("timeout --kill-after=1s 1s true"); + expect(script).toContain('timeout --kill-after=30s "$PODMAN_RUN_TIMEOUT" podman run "$@"'); expect(script).toContain('timeout "$PODMAN_RUN_TIMEOUT" podman run "$@"'); expect(script).toContain('podman run --pull="$PODMAN_PULL" --rm -it \\'); expect(script).toContain('run_podman_detached --pull="$PODMAN_PULL" -d --replace \\');