Files
cunkebao_v3/Moncter/start_debug.sh
2026-01-05 10:47:10 +08:00

39 lines
1001 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 数据采集任务调试启动脚本(显示实时日志)
# 使用方法: chmod +x start_debug.sh && ./start_debug.sh
set -e
echo "=================================================="
echo " 数据采集任务 - 调试模式启动"
echo " 实时显示所有日志输出"
echo "=================================================="
echo ""
# 检查 PHP
if ! command -v php &> /dev/null; then
echo "❌ 错误: 未找到 PHP请先安装 PHP"
exit 1
fi
echo "✓ PHP 版本: $(php -v | head -n 1)"
echo ""
# 停止已有进程
if [ -f "runtime/webman.pid" ]; then
echo "🛑 停止已运行的进程..."
php start.php stop
sleep 2
fi
# 以调试模式启动(不使用 daemon 模式,输出到终端)
echo "🚀 启动 Workerman调试模式..."
echo " 提示: 按 Ctrl+C 停止"
echo "=================================================="
echo ""
# 使用 start 而不是 start -ddaemon这样输出会显示在终端
php start.php start