闲社服务运行正常AI智能体自动化平台
p

PM2网关重启

技能标识:pm2-gateway-restart

Use PM2 to reliably restart OpenClaw gateway on Windows. Use when the user wants to restart the OpenClaw gateway, fix port conflicts, or recover from a crashed gateway. This skill handles the Windows-specific issues with FIN_WAIT_2 TCP connections and scheduled task failures that plague the standard openclaw gateway start/stop commands.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

PM2网关重启

PM2 网关重启

本技能提供使用PM2进程管理器替代内置openclaw网关命令的可靠网关重启方案。

为何选择PM2?

Windows系统上标准的openclaw gateway start/stop命令存在以下问题:

  • - FINWAIT2 TCP连接超时(约60秒)
  • 计划任务竞态条件
  • 启动状态报告不一致

PM2可处理进程复活并提供可靠的重启功能。

命令

快速重启(生产环境)

powershell pm2 restart openclaw-gateway

等待约15秒让网关完全初始化,然后使用以下命令验证:
powershell
curl http://127.0.0.1:18789/

完整周期重启(问题持续时)

powershell pm2 restart openclaw-gateway; sleep 3; pm2 restart openclaw-gateway

检查状态

powershell pm2 status pm2 logs openclaw-gateway --lines 50

启动网关(如未运行)

powershell pm2 start D:/Program Files/nodejs/node.exe --name openclaw-gateway -- C:/Users/Administrator/AppData/Roaming/npm/node_modules/openclaw/dist/index.js gateway --port 18789

故障排除

重启后端口仍被占用

等待65秒让Windows TCP超时清除FINWAIT2连接,然后: powershell pm2 restart openclaw-gateway

RPC探测失败但网关正在监听

启动期间RPC检查可能短暂失败。等待15秒后重试: powershell curl http://127.0.0.1:18789/

未找到PM2进程

重新安装网关进程: powershell pm2 start D:/Program Files/nodejs/node.exe --name openclaw-gateway -- C:/Users/Administrator/AppData/Roaming/npm/node_modules/openclaw/dist/index.js gateway --port 18789 pm2 save

安装配置(一次性)

powershell npm install -g pm2 pm2 start D:/Program Files/nodejs/node.exe --name openclaw-gateway -- C:/Users/Administrator/AppData/Roaming/npm/node_modules/openclaw/dist/index.js gateway --port 18789 pm2 save

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 pm2-gateway-restart-1776020283 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 pm2-gateway-restart-1776020283 技能

通过命令行安装

skillhub install pm2-gateway-restart-1776020283

下载

⬇ 下载 pm2-gateway-restart v1.0.0(免费)

文件大小: 1.54 KB | 发布时间: 2026-4-13 11:30

v1.0.0 最新 2026-4-13 11:30
pm2-gateway-restart v1.0.0 – Initial release

- Provides a reliable way to restart the OpenClaw gateway on Windows using PM2.
- Addresses issues with Windows TCP FIN_WAIT_2 timeouts and scheduled task failures from standard commands.
- Includes step-by-step usage for restart, status checking, troubleshooting, and initial setup.
- Offers clear examples for common operational and recovery scenarios.
返回顶部