|
|
|
|
# User-level systemd service for OpenClaw Gateway
|
|
|
|
|
# Install to: ~/.config/systemd/user/openclaw-gateway.service
|
|
|
|
|
# Required: loginctl enable-linger $(whoami)
|
|
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
|
Description=OpenClaw Gateway (v2026.2.19-2)
|
|
|
|
|
After=network-online.target
|
|
|
|
|
Wants=network-online.target
|
|
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
Type=simple
|
|
|
|
|
ExecStart=/www/server/nodejs/v24.13.1/bin/node /www/server/nodejs/v24.13.1/lib/node_modules/openclaw/dist/index.js gateway --port 18789
|
|
|
|
|
Restart=always
|
|
|
|
|
RestartSec=10
|
|
|
|
|
StartLimitInterval=300
|
|
|
|
|
StartLimitBurst=5
|
|
|
|
|
KillMode=process
|
|
|
|
|
TimeoutStopSec=30
|
|
|
|
|
|
|
|
|
|
# Critical environment variables for user-level systemd
|
|
|
|
|
Environment=HOME=/root
|
|
|
|
|
Environment=XDG_RUNTIME_DIR=/run/user/0
|
|
|
|
|
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
|
|
|
|
|
Environment=PATH=/root/.local/bin:/root/.npm-global/bin:/root/bin:/root/.volta/bin:/root/.asdf/shims:/root/.bun/bin:/root/.nvm/current/bin:/root/.fnm/current/bin:/root/.local/share/pnpm:/usr/local/bin:/usr/bin:/bin
|
|
|
|
|
Environment=OPENCLAW_GATEWAY_PORT=18789
|
|
|
|
|
Environment=OPENCLAW_GATEWAY_TOKEN=9e2e91b31a56fb56a35e91821c025267292ec44c26169b12
|
|
|
|
|
Environment=OPENCLAW_SYSTEMD_UNIT=openclaw-gateway.service
|
|
|
|
|
Environment=OPENCLAW_SERVICE_MARKER=openclaw
|
|
|
|
|
Environment=OPENCLAW_SERVICE_KIND=gateway
|
|
|
|
|
Environment=OPENCLAW_SERVICE_VERSION=2026.2.19-2
|
|
|
|
|
|
|
|
|
|
EnvironmentFile=-/root/.openclaw/workspace/systemd/gateway.env
|
|
|
|
|
|
|
|
|
|
MemoryMax=2G
|
|
|
|
|
CPUQuota=80%
|
|
|
|
|
|
|
|
|
|
StandardOutput=journal
|
|
|
|
|
StandardError=journal
|
|
|
|
|
SyslogIdentifier=openclaw-gateway
|
|
|
|
|
|
|
|
|
|
WatchdogSec=30
|
|
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=default.target
|