daemon-stop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/asciinema-tools:daemon-stop
/asciinema-tools:daemon-stop
Stop the asciinema chunker daemon via launchd.
通过launchd停止asciinema chunker守护进程。
Execution
执行步骤
Check if Running
检查是否正在运行
bash
/usr/bin/env bash << 'CHECK_EOF'
PLIST_PATH="$HOME/Library/LaunchAgents/com.cc-skills.asciinema-chunker.plist"
if ! [[ -f "$PLIST_PATH" ]]; then
echo "Daemon not installed."
exit 0
fi
if ! launchctl list 2>/dev/null | grep -q "asciinema-chunker"; then
echo "Daemon not running."
exit 0
fi
echo "RUNNING"
CHECK_EOFbash
/usr/bin/env bash << 'CHECK_EOF'
PLIST_PATH="$HOME/Library/LaunchAgents/com.cc-skills.asciinema-chunker.plist"
if ! [[ -f "$PLIST_PATH" ]]; then
echo "Daemon not installed."
exit 0
fi
if ! launchctl list 2>/dev/null | grep -q "asciinema-chunker"; then
echo "Daemon not running."
exit 0
fi
echo "RUNNING"
CHECK_EOFStop Daemon
停止守护进程
bash
/usr/bin/env bash << 'STOP_EOF'
PLIST_PATH="$HOME/Library/LaunchAgents/com.cc-skills.asciinema-chunker.plist"
if launchctl unload "$PLIST_PATH"; then
echo "Daemon stopped"
# Verify
sleep 1
if launchctl list 2>/dev/null | grep -q "asciinema-chunker"; then
echo "WARNING: Daemon may still be running"
else
echo "Confirmed: Daemon is no longer running"
fi
else
echo "ERROR: Failed to stop daemon"
exit 1
fi
STOP_EOFbash
/usr/bin/env bash << 'STOP_EOF'
PLIST_PATH="$HOME/Library/LaunchAgents/com.cc-skills.asciinema-chunker.plist"
if launchctl unload "$PLIST_PATH"; then
echo "Daemon stopped"
# Verify
sleep 1
if launchctl list 2>/dev/null | grep -q "asciinema-chunker"; then
echo "WARNING: Daemon may still be running"
else
echo "Confirmed: Daemon is no longer running"
fi
else
echo "ERROR: Failed to stop daemon"
exit 1
fi
STOP_EOFOutput
输出
On success:
Daemon stopped
Confirmed: Daemon is no longer running成功时:
Daemon stopped
Confirmed: Daemon is no longer runningNotes
注意事项
- Stopping the daemon does NOT delete credentials from Keychain
- To restart:
/asciinema-tools:daemon-start - The daemon will NOT auto-start on next login until started again
- 停止守护进程不会删除Keychain中的凭证
- 如需重启:执行
/asciinema-tools:daemon-start - 在再次启动之前,该守护进程下次登录时不会自动启动
Troubleshooting
故障排查
| Issue | Cause | Solution |
|---|---|---|
| Failed to stop daemon | Launchd error | Try |
| Daemon still running | Multiple instances | Kill manually: |
| Can't find plist | Setup not run | Run |
| Recordings not stopping | asciinema rec is running | Exit recording shell first (Ctrl-D or type exit) |
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 无法停止守护进程 | Launchd错误 | 尝试执行 |
| 守护进程仍在运行 | 存在多个实例 | 手动终止: |
| 找不到plist文件 | 未运行初始化设置 | 请先执行 |
| 录制未停止 | asciinema rec进程正在运行 | 先退出录制shell(按Ctrl-D或者输入exit) |