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