Skip to content

[Bug]: openclaw gateway restart fails while user systemd service works via systemctl --user (service shown as disabled/stopped inconsistently) #40275

@MelBourbon

Description

@MelBourbon

Bug type

Regression (worked before, now fails)

Summary

openclaw gateway restart does not reliably restart the gateway and reports service disabled/stopped, although the user systemd unit exists and can be started/restarted with systemctl --user ... (with proper user DBus env)

Important extra context

Old workaround commands that used to help do not fix it anymore in this setup:

sudo loginctl enable-linger $(whoami)
export XDG_RUNTIME_DIR=/run/user/$(id -u)

Even with linger enabled + runtime env export, openclaw gateway restart can still fail / report disabled incorrectly.

Additional notes

• systemctl status openclaw-gateway.service (without --user) says unit not found (expected)
• systemctl --user status openclaw-gateway.service shows active/running
• Looks like CLI service detection/restart path may not always target the correct user systemd context.

Steps to reproduce

  1. Update to OpenClaw 2026.3.7
  2. Run openclaw gateway restart
  3. Observe disabled/stopped style output / restart failure
  4. Run systemctl --user restart openclaw-gateway.service (+ env exports)
  5. Observe service starts fine

Expected behavior

openclaw gateway restart should restart the gateway service directly without needing manual systemd user env exports.

Actual behavior

openclaw gateway restart should restart the gateway service directly without needing manual systemd user env exports.

• CLI output shows:
• Service: systemd (disabled)
• Runtime: stopped
• RPC probe: failed
• But service file exists at:
• ~/.config/systemd/user/openclaw-gateway.service
• Manual restart works with:

export XDG_RUNTIME_DIR=/run/user/$(id -u)
export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus
systemctl --user daemon-reload
systemctl --user enable --now openclaw-gateway.service
systemctl --user restart openclaw-gateway.service

OpenClaw version

2026.3.7

Operating system

Ubuntu 24.04 (Linux), user is root in this setup

Install method

npm global

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions