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_EOF
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_EOF

Stop 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_EOF
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_EOF

Output

输出

On success:
Daemon stopped
Confirmed: Daemon is no longer running
成功时:
Daemon stopped
Confirmed: Daemon is no longer running

Notes

注意事项

  • 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

故障排查

IssueCauseSolution
Failed to stop daemonLaunchd errorTry
launchctl unload -F <plist-path>
Daemon still runningMultiple instancesKill manually:
pkill -f asciinema-chunker
Can't find plistSetup not runRun
/asciinema-tools:daemon-setup
first
Recordings not stoppingasciinema rec is runningExit recording shell first (Ctrl-D or type exit)
问题原因解决方案
无法停止守护进程Launchd错误尝试执行
launchctl unload -F <plist-path>
守护进程仍在运行存在多个实例手动终止:
pkill -f asciinema-chunker
找不到plist文件未运行初始化设置请先执行
/asciinema-tools:daemon-setup
录制未停止asciinema rec进程正在运行先退出录制shell(按Ctrl-D或者输入exit)