GBHub 国标视频平台性能优化实践
2026/9/5 7:44:49
# ==================== supervisord 自动启动 ==================== SUPERVISOR_CONF="/etc/supervisord.conf" PIDFILE="/tmp/supervisord.pid" SUPERVISORD_LOG="/var/log/supervisord.log" mkdir -p /var/log log_print() { local msg="$1" echo -e "${msg}" echo "[$(date '+%Y-%m-%d %H:%M:%S')] ${msg}" >> "${SUPERVISORD_LOG}" } # 检查 supervisord 是否真正活着 is_supervisord_alive() { if supervisorctl status &>/dev/null; then return 0 fi if pgrep -f "supervisord" &>/dev/null; then return 0 fi if [[ -f "${PIDFILE}" ]]; then local pid pid=$(cat "${PIDFILE}" 2>/dev/null) if [[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null; then return 0 fi fi