关于 uninstall-watchdog
uninstall-watchdog 是用于卸载 egregore watchdog 守护进程的技能,面向不再需要自动重新启动会话的项目维护者。它指导停止并移除 macOS 或 Linux 服务、清理关联文件并验证卸载结果。
主要功能
- 01停止并移除 watchdog 服务
- 02清理 PID 文件和日志
- 03验证服务已卸载
- 04支持 macOS 与 Linux
适用场景
- 01关闭 egregore 会话的自动重新启动
- 02移除项目中的 egregore 插件前清理
- 03从守护进程模式切换为手动调用
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ athola/ claude-night-market --skill uninstall-watchdog安装后在 Claude Code 中输入/uninstall-watchdog确认已加载。
详细介绍
卸载 Watchdog
概述
移除 egregore watchdog 守护进程,并清理所有由 install-watchdog 技能创建的文件。 卸载后,egregore 会话将不再自动重新启动。
适用场景
- 不再需要自动重新启动时。
- 从项目中移除 egregore 插件之前。
- 从守护进程模式切换为手动调用时。
不适用场景
- 尚未安装 watchdog 时(请先使用下方的验证命令检查)。
卸载步骤
1. 检测操作系统
OS=$(uname -s)
2. 停止并移除服务
macOS(launchd):
PLIST=~/Library/LaunchAgents/com.egregore.watchdog.plist
# Unload the agent (stops it if running)
launchctl unload "$PLIST" 2>/dev/null
# Remove the plist file
rm -f "$PLIST"
Linux(systemd):
# Stop and disable the timer and service
systemctl --user stop egregore-watchdog.timer 2>/dev/null
systemctl --user disable egregore-watchdog.timer 2>/dev/null
# Remove unit files
rm -f ~/.config/systemd/user/egregore-watchdog.timer
rm -f ~/.config/systemd/user/egregore-watchdog.service
# Reload systemd to pick up the removal
systemctl --user daemon-reload
3. 清理相关文件
# Remove pidfile if present
rm -f ~/.egregore/watchdog.pid
# Remove watchdog log
rm -f ~/.egregore/watchdog.log
4. 确认移除
macOS:
launchctl list | grep egregore
# Should produce no output
Linux:
systemctl --user list-timers | grep egregore
# Should produce no output
告知用户 watchdog 已移除,且自动重新启动功能已禁用。
已移除的文件
| 文件 | 平台 | 用途 |
|---|---|---|
~/Library/LaunchAgents/com.egregore.watchdog.plist | macOS | launchd 代理定义 |
~/.config/systemd/user/egregore-watchdog.timer | Linux | systemd 定时器单元 |
~/.config/systemd/user/egregore-watchdog.service | Linux | systemd 服务单元 |
~/.egregore/watchdog.pid | 两者 | 上次 watchdog 运行的 PID |
~/.egregore/watchdog.log | macOS | watchdog 输出日志 |
完成标准
- 在 macOS 上:卸载完成后,
~/Library/LaunchAgents/com.egregore.watchdog.plist不存在 - 在 Linux 上:
~/.config/systemd/user/egregore-watchdog.timer和egregore-watchdog.service均已移除,且已运行systemctl --user daemon-reload - 验证命令返回空输出:
launchctl list | grep egregore(macOS)或systemctl --user list-timers | grep egregore(Linux) -
~/.egregore/watchdog.pid和~/.egregore/watchdog.log已移除(如果从未创建,则本来就不存在) - 已告知用户 watchdog 已移除,且自动重新启动功能已禁用
评论
支持 Markdown