From 3c9bf95728a72ae1d6730a7695cd812d9c844d67 Mon Sep 17 00:00:00 2001 From: dami Date: Thu, 2 Oct 2025 12:14:16 +0800 Subject: [PATCH] Update check.sh --- plugins/openresty/check.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/openresty/check.sh b/plugins/openresty/check.sh index 8a885bcac..5a8ce3ffd 100755 --- a/plugins/openresty/check.sh +++ b/plugins/openresty/check.sh @@ -10,6 +10,7 @@ if systemctl is-active --quiet "$service_name"; then # 检查是否存在僵尸进程 zombie_processes=$(ps -ef | grep -i openresty | grep -v grep | awk '{print $2}' | xargs ps -o state= -p 2>/dev/null | grep -c Z) if [ "$zombie_processes" -gt 0 ]; then + echo "kill nginx" ps -ef|grep nginx| grep -v grep| awk '{print $2}' | xargs kill -9 echo "检测到OpenResty僵尸进程,正在重启服务..." systemctl restart "$service_name" @@ -18,6 +19,7 @@ if systemctl is-active --quiet "$service_name"; then echo "OpenResty运行正常" fi else + echo "kill nginx" ps -ef|grep nginx| grep -v grep| awk '{print $2}' | xargs kill -9 echo "OpenResty未运行,正在启动服务..." systemctl start "$service_name"