@@ -36,6 +36,14 @@ fail() {
|
36 | 36 | exit 1 |
37 | 37 | } |
38 | 38 | |
| 39 | +run_podman_detached() { |
| 40 | +if command -v timeout >/dev/null 2>&1; then |
| 41 | + timeout "$PODMAN_RUN_TIMEOUT" podman run "$@" |
| 42 | +return |
| 43 | +fi |
| 44 | + podman run "$@" |
| 45 | +} |
| 46 | + |
39 | 47 | validate_single_line_value() { |
40 | 48 | local label="$1" |
41 | 49 | local value="$2" |
@@ -167,7 +175,7 @@ load_podman_env_file() {
|
167 | 175 | key="${key%"${key##*[![:space:]]}"}" |
168 | 176 | [[ "$key" =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue |
169 | 177 | case "$key" in |
170 | | - OPENCLAW_GATEWAY_TOKEN|OPENCLAW_PODMAN_CONTAINER|OPENCLAW_PODMAN_IMAGE|OPENCLAW_IMAGE|OPENCLAW_PODMAN_PULL|OPENCLAW_PODMAN_GATEWAY_HOST_PORT|OPENCLAW_GATEWAY_PORT|OPENCLAW_PODMAN_BRIDGE_HOST_PORT|OPENCLAW_BRIDGE_PORT|OPENCLAW_GATEWAY_BIND|OPENCLAW_PODMAN_USERNS|OPENCLAW_BIND_MOUNT_OPTIONS|OPENCLAW_PODMAN_PUBLISH_HOST) |
| 178 | + OPENCLAW_GATEWAY_TOKEN|OPENCLAW_PODMAN_CONTAINER|OPENCLAW_PODMAN_IMAGE|OPENCLAW_IMAGE|OPENCLAW_PODMAN_PULL|OPENCLAW_PODMAN_RUN_TIMEOUT|OPENCLAW_PODMAN_GATEWAY_HOST_PORT|OPENCLAW_GATEWAY_PORT|OPENCLAW_PODMAN_BRIDGE_HOST_PORT|OPENCLAW_BRIDGE_PORT|OPENCLAW_GATEWAY_BIND|OPENCLAW_PODMAN_USERNS|OPENCLAW_BIND_MOUNT_OPTIONS|OPENCLAW_PODMAN_PUBLISH_HOST) |
171 | 179 | ;; |
172 | 180 | *) |
173 | 181 | continue |
@@ -236,6 +244,7 @@ WORKSPACE_DIR="${OPENCLAW_WORKSPACE_DIR:-$CONFIG_DIR/workspace}"
|
236 | 244 | CONTAINER_NAME="${OPENCLAW_PODMAN_CONTAINER:-openclaw}" |
237 | 245 | OPENCLAW_IMAGE="${OPENCLAW_PODMAN_IMAGE:-${OPENCLAW_IMAGE:-openclaw:local}}" |
238 | 246 | PODMAN_PULL="${OPENCLAW_PODMAN_PULL:-never}" |
| 247 | +PODMAN_RUN_TIMEOUT="${OPENCLAW_PODMAN_RUN_TIMEOUT:-600s}" |
239 | 248 | HOST_GATEWAY_PORT="${OPENCLAW_PODMAN_GATEWAY_HOST_PORT:-${OPENCLAW_GATEWAY_PORT:-18789}}" |
240 | 249 | HOST_BRIDGE_PORT="${OPENCLAW_PODMAN_BRIDGE_HOST_PORT:-${OPENCLAW_BRIDGE_PORT:-18790}}" |
241 | 250 | PUBLISH_HOST="${OPENCLAW_PODMAN_PUBLISH_HOST:-127.0.0.1}" |
@@ -546,7 +555,7 @@ if [[ "$RUN_SETUP" == true ]]; then
|
546 | 555 | fi |
547 | 556 | |
548 | 557 | TOKEN_ENV_FILE="$(create_token_env_file "$ENV_FILE" "$OPENCLAW_GATEWAY_TOKEN")" |
549 | | -podman run --pull="$PODMAN_PULL" -d --replace \ |
| 558 | +run_podman_detached --pull="$PODMAN_PULL" -d --replace \ |
550 | 559 | --name "$CONTAINER_NAME" \ |
551 | 560 | --init \ |
552 | 561 | "${USERNS_ARGS[@]}" "${RUN_USER_ARGS[@]}" \ |
|