openclaw - 💡(How to fix) Fix systemd integration broken due to fork/respawn pattern

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…

OpenClaw's self-respawn/fork pattern makes systemd integration unreliable. After systemctl restart openclaw:

  1. The ExecStart process starts the gateway
  2. Gateway forks to a new PID
  3. Original process exits
  4. systemd reports "failed" because the tracked process exited
  5. The actual gateway runs fine under the forked PID

This means systemctl status always shows "failed", journalctl loses log continuity, and systemd health monitoring is useless.

Root Cause

  1. The ExecStart process starts the gateway
  2. Gateway forks to a new PID
  3. Original process exits
  4. systemd reports "failed" because the tracked process exited
  5. The actual gateway runs fine under the forked PID

Fix Action

Fix / Workaround

Current Workaround

RAW_BUFFERClick to expand / collapse

Summary

OpenClaw's self-respawn/fork pattern makes systemd integration unreliable. After systemctl restart openclaw:

  1. The ExecStart process starts the gateway
  2. Gateway forks to a new PID
  3. Original process exits
  4. systemd reports "failed" because the tracked process exited
  5. The actual gateway runs fine under the forked PID

This means systemctl status always shows "failed", journalctl loses log continuity, and systemd health monitoring is useless.

Current Workaround

Using Type=forking with RestartPreventExitStatus=78 and accepting that systemd will always show "failed" after restart.

Suggestion

  • Support a --no-fork or --foreground flag so systemd can track the process directly with Type=simple
  • Or document the recommended systemd unit configuration

Environment

  • OpenClaw: 2026.5.12, 2026.5.18
  • systemd 252 (Debian 12)

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 systemd integration broken due to fork/respawn pattern