Skip to content

[Bug]: auto-update can never succeed under systemd — updater is spawned as a child of the gateway it needs to restart #83360

Description

@boycez

[Bug]: auto-update can never succeed under systemd — updater is spawned as a child of the gateway it needs to restart

Summary

With update.auto.enabled = true and OpenClaw running as the standard systemd user service (openclaw-gateway.service), the hourly auto-update attempt always fails with:

openclaw update detected it is running inside the gateway process tree.
Gateway PID is an ancestor of this process, so this updater cannot safely stop or restart the gateway that owns it.
Run openclaw update from a shell outside the gateway service, or stop the gateway service first and then update.

Followed by:

auto-update attempt failed   {"channel":"stable","version":"2026.5.12","tag":"latest","reason":"non-zero-exit"}

The two behaviors contradict each other:

  1. The gateway's auto-update scheduler spawns openclaw update as a child of the gateway process.
  2. openclaw update has a safety check that aborts when the gateway is its ancestor.

Net effect: on every systemd install, auto-update is effectively a no-op and the user silently stays behind. My box has been failing every hour since at least 2026-05-17, stuck on 2026.5.4 while 2026.5.12 is current.

Environment

  • OpenClaw 2026.5.4 (325df3e)
  • Latest on npm: 2026.5.12
  • Service: systemd --user (openclaw-gateway.service, command node .../dist/index.js gateway --port 18789)
  • OS: Linux 6.17.0-1010-azure x64, Node v22.22.2
  • Install: global npm (~/.npm-global/lib/node_modules/openclaw)
  • Config:
    "update": {
      "channel": "stable",
      "auto": { "enabled": true, "stableDelayHours": 6, "stableJitterHours": 12 }
    }

Reproduction

  1. Install OpenClaw globally via npm.
  2. Run it as the systemd user service (openclaw gateway defaults).
  3. Leave update.auto.enabled = true.
  4. Wait for the auto-update tick (hourly retries after a failed attempt).
  5. Observe in /tmp/openclaw/openclaw-YYYY-MM-DD.log:
    • ERROR "openclaw update detected it is running inside the gateway process tree..."
    • INFO auto-update attempt failed { reason: "non-zero-exit" }
  6. openclaw --version stays pinned to the installed version; npm view openclaw version is newer.

Expected

Auto-update should be able to complete under the standard systemd install. Options:

  • Spawn the updater detached (setsid / new session, stdio: 'ignore', detached: true, and not parented by the gateway service unit), so it is no longer an ancestor of the updater process. The updater can then ask systemd to restart the unit (systemctl --user restart openclaw-gateway.service) without killing its own parent.
  • Or: have the gateway hand off to a tiny external "updater" oneshot unit (e.g. openclaw-updater.service triggered via systemd-run --user --unit=openclaw-updater ...), so the updater is owned by systemd, not by the gateway, and is free to stop/start the gateway unit.
  • Or, at minimum: surface this failure prominently (status card, openclaw status, dashboard banner) instead of only in the file log, so users notice they're stuck.

Actual

Auto-update silently fails forever. No surface in openclaw gateway status, no user-visible warning, only an hourly error buried in /tmp/openclaw/openclaw-*.log.

Workaround

Run openclaw update from a shell outside the gateway process tree (plain SSH session works), or stop the service first:

systemctl --user stop openclaw-gateway.service
npm install -g openclaw@latest   # or: openclaw update
systemctl --user start openclaw-gateway.service

Log excerpt

2026-05-17T10:00:04Z ERROR openclaw update detected it is running inside the gateway process tree.
                            Gateway PID 781034 is an ancestor of this process...
2026-05-17T10:00:04Z INFO  auto-update attempt failed  {channel:"stable", version:"2026.5.12", reason:"non-zero-exit"}

(Repeats every hour through to today.)

Metadata

Metadata

Assignees

Labels

P2Normal backlog priority with limited blast radius.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions