This commit is contained in:
vet
2026-04-20 23:27:25 +07:00
parent 4bd0efc8f5
commit 13dfe7fe79

View File

@@ -28,6 +28,7 @@ declare -A FE_PORT_NUM=(
_stop_fe() {
local name="$1"
local pidfile="$PID_DIR/fe-${name}.pid"
local port="${FE_PORT_NUM[$name]}"
if [[ -f "$pidfile" ]]; then
local pid; pid=$(cat "$pidfile")
if kill -0 "$pid" 2>/dev/null; then
@@ -37,13 +38,13 @@ _stop_fe() {
if kill -0 "$pid" 2>/dev/null; then
_kill_tree "$pid" KILL
fi
success "$name 已停止 (PID=$pid)"
success "$name 已停止 (端口=$port, PID=$pid)"
else
warn "$name 进程不存在(可能已退出)"
warn "$name 进程不存在(端口=$port可能已退出)"
fi
rm -f "$pidfile"
else
warn "$name 没有 PID 记录(未运行)"
warn "$name 没有 PID 记录(端口=$port未运行)"
fi
_stop_fe_port "$name"