Skip to content

gateway start fails on fresh Ubuntu when systemd service is disabled or not-found #34791

Description

@alphak3y

Bug

openclaw gateway start crashes on a fresh Ubuntu 24.04 EC2 instance because systemctl --user is-enabled openclaw-gateway.service returns a non-zero exit code for both not-found and disabled states.

Environment

  • OS: Ubuntu 24.04.3 LTS (Noble Numbat) on EC2
  • OpenClaw: 2026.3.2 (85377a2)
  • Node: v22

Steps to Reproduce

  1. Fresh Ubuntu 24.04 EC2 instance
  2. Install OpenClaw via openclaw setup
  3. Run openclaw gateway start

Error

Gateway service check failed: Error: systemctl is-enabled unavailable: Command failed: systemctl --user is-enabled openclaw-gateway.service

Root Cause

systemctl --user is-enabled returns:

  • Exit code 1 for disabled
  • Exit code 1 for not-found

The gateway start command treats any non-zero exit code as a hard failure instead of handling these expected states.

Workaround

Manually create and enable a stub service unit before running openclaw gateway start:

mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/openclaw-gateway.service << EOF
[Unit]
Description=OpenClaw Gateway
[Service]
ExecStart=/bin/true
Restart=no
[Install]
WantedBy=default.target
EOF
systemctl --user daemon-reload
systemctl --user enable openclaw-gateway.service
openclaw gateway start

Expected Behavior

openclaw gateway start (and setup) should handle not-found and disabled responses from systemctl is-enabled gracefully — these are normal states for a first-time install.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions