Context: I am running OpenClaw version 2026.4.15 inside a Docker container named openclaw-gateway on a WSL2 host. To manage known MCP server memory leaks (Issue #60656), I have an internal cron job in jobs.json set to restart the gateway nightly.
The Issue: The internal task fails to execute the restart, even though the gateway is active. Job Triggered: gateway-mcp-restart ran at 03:15:17 IST. Command: openclaw gateway restart. Failure Log: The CLI returned: Gateway service disabled. Start with: openclaw gateway install.
Observation: Because the gateway is the container's primary entrypoint, there is no systemd service manager inside the container to handle the CLI's restart request. When this restart fails, my host memory usage balloons to 71% and the Docker Desktop Backend spikes to 55% CPU.
Questions:In version 2026.4.15, is openclaw gateway restart intended to work within a Docker container that lacks a service manager? Is there a "soft restart" CLI flag that can recycle the gateway and its MCP child processes without requiring systemctl? If the internal cron is fundamentally incompatible with a Docker-entrypoint setup, is moving the restart task to the host-level crontab (using docker restart) the recommended production path for 24/7 autonomous agents?
#Internal gateway restart fails with "service disabled" in Docker-native environments
1 messages · Page 1 of 1 (latest)
Let me verify this against the docs and source so I don't guess.
I found something important: current source does have an unmanaged-process SIGUSR1 restart path, but I want to check whether that actually existed in 2026.4.15 or landed later.
Short version: yes, for a Docker-entrypoint gateway, I’d move the restart outside the gateway.
-
The docs still describe
openclaw gateway restartas a background service restart, whileopenclaw gatewayis the foreground process. So a plain container with no systemd/launchd is not the primary target for that command.
https://docs.openclaw.ai/help/faq
https://docs.openclaw.ai/cli/gateway -
I do see a newer source-level fallback for unmanaged gateways that sends
SIGUSR1to the running listener, but there is no separate--soft-restartflag for “recycle MCP children only”. So, no documented soft-restart CLI for your case. -
For Docker deployments, the docs already lean on container/orchestrator lifecycle. The image exposes health checks, and the expectation is that Docker/Compose/K8s restarts or replaces unhealthy containers.
https://docs.openclaw.ai/install/docker
My recommendation for a 24/7 setup:
- Do not rely on internal cron +
openclaw gateway restartinside a plain Docker entrypoint container. - Schedule
docker restart openclaw-gatewayfrom the host (or Compose/systemd/K8s equivalent). - Keep a Docker restart policy + healthcheck as a safety net.
If you want, I can help write the exact WSL2 host cron entry or a Docker healthcheck/watchdog setup.
If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution, so Answer Overflow can index it.
yes.. can you help me
Yep. I’d set this up as an external container restart, not an internal openclaw gateway restart.
Recommended setup
1) Test the restart path once manually
From the WSL host:
docker restart openclaw-gateway
docker ps --filter name=openclaw-gateway
docker inspect -f '{{.State.StartedAt}}' openclaw-gateway
curl -fsS http://127.0.0.1:18789/healthz
If that works, you’ve got the right recovery path.
2) Use host cron in WSL
If your WSL distro stays running, add a cron entry:
crontab -e
Example, daily at 03:15:
15 3 * * * /usr/bin/docker restart openclaw-gateway >> /tmp/openclaw-restart.log 2>&1
If Docker is on a different path, check with:
command -v docker
3) Better option on WSL2: Windows Task Scheduler
This is usually more reliable than WSL cron, because WSL distros can go idle.
- Program:
wsl.exe - Arguments:
-d <YourDistroName> -- docker restart openclaw-gateway
If you want, I can help you turn that into an exact Task Scheduler entry.
Keep these too
In Compose:
restart: unless-stopped
The image already has a healthcheck, which is good for crashes, but for a known leak a scheduled docker restart is the cleaner fix.
What I’d change now
- Remove/disable the internal cron job that runs
openclaw gateway restart - Replace it with host-level
docker restart openclaw-gateway
If you paste your docker-compose.yml or say whether you want WSL cron or Windows Task Scheduler, I’ll write the exact config for you.