test
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user