openclaw - 💡(How to fix) Fix gateway restart uses systemctl stop which overrides Restart=always, causing dead service

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When the OpenClaw gateway tool or openclaw gateway stop is invoked, it calls systemctl --user stop openclaw-gateway.service but does NOT follow up with systemctl --user start. Since systemctl stop is an explicit management command, it overrides the unit's Restart=always directive, leaving the service in inactive (dead) state.

Root Cause

systemctl stop is an explicit admin action that tells systemd "the operator stopped this service." systemd respects this over Restart=always and does not auto-restart.

Fix Action

Fix

  • Replace systemctl stop + delayed start with a single systemctl --user restart openclaw-gateway.service
  • Or for process-level restart (SIGUSR1): let the process exit cleanly (process.exit(0)) so systemd's Restart=always handles the restart, rather than calling systemctl stop first

Workaround

Always use systemctl --user restart openclaw-gateway instead of openclaw gateway stop.

Code Example

May 20 09:38:08 systemd[825]: Stopping openclaw-gateway.service
May 20 09:38:08 node[79384]: gateway signal SIGTERM received
May 20 09:38:09 systemd[825]: Stopped openclaw-gateway.service

---

Restart=always
RestartSec=5
SuccessExitStatus=0 143
RAW_BUFFERClick to expand / collapse

Summary

When the OpenClaw gateway tool or openclaw gateway stop is invoked, it calls systemctl --user stop openclaw-gateway.service but does NOT follow up with systemctl --user start. Since systemctl stop is an explicit management command, it overrides the unit's Restart=always directive, leaving the service in inactive (dead) state.

Environment

  • OpenClaw: v2026.5.18
  • OS: Ubuntu 24.04, systemd 255
  • Service: user-scope systemd unit with Restart=always

Reproduction

  1. Run openclaw gateway stop or trigger a gateway restart via the gateway tool
  2. Check systemctl --user status openclaw-gateway
  3. Service is inactive (dead) instead of restarting automatically

Log Evidence

May 20 09:38:08 systemd[825]: Stopping openclaw-gateway.service
May 20 09:38:08 node[79384]: gateway signal SIGTERM received
May 20 09:38:09 systemd[825]: Stopped openclaw-gateway.service

No subsequent Starting openclaw-gateway.service line.

Service Config (correct, not the problem)

Restart=always
RestartSec=5
SuccessExitStatus=0 143

Root Cause

systemctl stop is an explicit admin action that tells systemd "the operator stopped this service." systemd respects this over Restart=always and does not auto-restart.

Fix

  • Replace systemctl stop + delayed start with a single systemctl --user restart openclaw-gateway.service
  • Or for process-level restart (SIGUSR1): let the process exit cleanly (process.exit(0)) so systemd's Restart=always handles the restart, rather than calling systemctl stop first

Workaround

Always use systemctl --user restart openclaw-gateway instead of openclaw gateway stop.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix gateway restart uses systemctl stop which overrides Restart=always, causing dead service