返回顶部
p

pm2-gateway-restartPM2网关重启

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
安全检测
已通过
93
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

pm2-gateway-restart

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.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部