ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

cygwin (双击启动,supervisor状态监控+关闭时需要密码)

cygwin (双击启动,supervisor状态监控+关闭时需要密码) .bashrc (交互式启动文件)# ==================== 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
返回列表