Token导航 LogoToken导航TokenDH.com
效率执行命令clawhub未标认证来源可访问clear审计通过

openclaw-gateway-linux-fixOpenClaw gateway linux FIX 效率

Agent Skill

openclaw-gateway-linux-fix 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 OpenClaw 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,277

周安装

173

GitHub Stars

1

下载量

1,342
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openclaw-gateway-linux-fix(OpenClaw gateway linux FIX 效率)
来源仓库:https://github.com/maksmirnnov/openclaw-gateway-linux-fix
安装命令:
openclaw skills install openclaw-gateway-linux-fix
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install openclaw-gateway-linux-fix

简介

专用于修复 Linux 环境下 OpenClaw Gateway 的状态异常问题,解决“禁用”误报。

  • 当服务实际运行但 CLI 显示错误状态时使用,提供诊断脚本与手动修复指引。
  • 依赖系统命令与进程检查,自动识别常见陷阱如端口占用或配置冲突。
  • 需 root 或 sudo 权限执行底层操作,误用可能导致服务中断,建议备份后操作。
  • 覆盖场景有限,如遇复杂故障仍需结合日志分析,官方论坛有详细案例参考。

SKILL.md

name
openclaw-gateway-linux-fix
description
Fix and diagnose OpenClaw Gateway service issues on Linux. Use when the gateway service shows "disabled" status despite running, when openclaw gateway status or openclaw status reports incorrect service state, or when systemctl --user fails with "No medium found" or "Failed to connect to bus". The most common fix — adding XDG_RUNTIME_DIR to shell environment — does NOT work. The correct fix is adding these vars to the systemd unit file so the gateway process itself can query its own status. Also covers safe restart without self-kill and shell escalation gotchas.

OpenClaw Gateway — Linux Fixes

Issue 1: Gateway shows "disabled" despite running

Symptom: openclaw status or openclaw gateway status shows disabled, but the service is actually running.

Root cause: The gateway process spawns systemctl --user is-enabled without XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS in its environment. Without these, systemd user bus is unreachable → "Failed to connect to bus: No medium found".

⚠️ Common wrong fix: Adding these vars to ~/.bashrc or shell environment does NOT help — the gateway daemon doesn't inherit your shell env.

Correct fix: Add the vars directly to the systemd unit file:

RUNTIME_DIR="/run/user/$(id -u)"
UNIT=~/.config/systemd/user/openclaw-gateway.service

# Append env vars after [Service] line (idempotent check first)
grep -q "XDG_RUNTIME_DIR" "$UNIT" || UNIT="$UNIT" RUNTIME="$RUNTIME_DIR" python3 -c "
import re, os
unit, runtime = os.environ['UNIT'], os.environ['RUNTIME']
content = open(unit).read()
insert = '\
Environment=XDG_RUNTIME_DIR=' + runtime + '\
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=' + runtime + '/bus'
content = re.sub(r'(\[Service\])', r'\1' + insert, content, count=1)
open(unit, 'w').write(content)
print('Unit file updated.')
"

# Reload and restart safely (see Issue 2 for post-restart status check)
systemctl --user daemon-reload
nohup bash -c 'sleep 2 && systemctl --user restart openclaw-gateway' > /tmp/gw-restart.log 2>&1 &

Expected result: Service: systemd (enabled)


Issue 2: Safe gateway restart

Problem: openclaw gateway restart and systemctl --user restart openclaw-gateway send SIGTERM to the gateway, which also kills the entire process tree — including the agent turn that triggered the restart. Any work scheduled after the restart command in the same process will never execute.

Root cause: The agent runs as a child process of the gateway. SIGTERM propagates down the tree on shutdown.

Step 1: Schedule post-restart work via cron

Since the agent dies with the gateway, any follow-up work must be pre-scheduled before the restart using openclaw cron add --at.

The cron scheduler runs inside the gateway and fires independently once the gateway comes back up (~5–7 seconds). Schedule it ~15 seconds ahead to be safe.

AT=$(date -u +"%Y-%m-%dT%H:%M:%S+00:00" --date="+15 seconds") && \
openclaw cron add \
  --name "gw-restart-notify" \
  --at "$AT" \
  --message "Gateway was restarted. Check status: systemctl --user status openclaw-gateway --no-pager | head -4 and report back." \
  --announce \
  --to <TELEGRAM_CHAT_ID> \
  --channel telegram \
  --delete-after-run \
  --session isolated

Step 2: Trigger the restart

nohup bash -c 'sleep 2 && systemctl --user restart openclaw-gateway' > /tmp/gw-restart.log 2>&1 &

sleep 2 + & detaches the restart from the current process tree before the gateway shuts down.

⚠️ Do NOT chain status checks after this command (e.g. && sleep 5 && systemctl status) — they will be killed too.

Passing context across the restart

If the agent needs to continue a task after restart, save context to a file before restarting and reference it in the cron message:

echo "Was doing X, next step is Y, params: Z" > /tmp/restart-context.txt

AT=$(date -u +"%Y-%m-%dT%H:%M:%S+00:00" --date="+15 seconds") && \
openclaw cron add \
  --name "gw-restart-continue" \
  --at "$AT" \
  --message "Continue the task. Context is in /tmp/restart-context.txt — read it and proceed." \
  --announce \
  --to <TELEGRAM_CHAT_ID> \
  --channel telegram \
  --delete-after-run \
  --session isolated

The isolated agent spawned by cron will read the file and continue from where the previous agent left off.

What does NOT work

  • sleep N && systemctl status chained after restart — killed by SIGTERM
  • setsid / systemd-run for post-restart notification — process survives but cannot reach Telegram (direct API access blocked in some regions; gateway is the only working path)
  • curl directly to Telegram API — may time out if blocked at network level

Issue 3: openclaw gateway status shows "disabled" in SSH session

This is a separate issue from Issue 1 — the gateway itself works fine, but your shell session lacks XDG_RUNTIME_DIR.

Affected: sudo su (without -), non-login shells, cron, sudo openclaw.

Fix: Add to ~/.bashrc and /etc/profile.d/openclaw-env.sh:

export XDG_RUNTIME_DIR=/run/user/$(id -u)
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus

Shell escalation cheatsheet:

CommandResultWhy
sudo su -✅ worksFull login shell, reads .bashrc
sudo -i✅ worksLogin shell (if vars in .bashrc)
sudo su❌ failsNon-login shell, env not loaded
sudo openclaw❌ failsClean env, vars stripped by sudo

Issue 4: Service not persisting after reboot

OpenClaw runs as a user-scope systemd service (~/.config/systemd/user/), not system-scope. Without linger, user services stop when the last session closes.

loginctl enable-linger $(whoami)   # persist after logout
systemctl --user enable openclaw-gateway  # auto-start on boot

See references/diagnosis.md for a full diagnostic checklist.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

87.24%
按下载量换算1,171

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install openclaw-gateway-linux-fix 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills