统一个人测算入参与重启脚本进程识别

This commit is contained in:
wkc
2026-04-10 15:04:56 +08:00
parent f001047d0c
commit fa0b446699
46 changed files with 903 additions and 87 deletions

View File

@@ -83,7 +83,16 @@ collect_pids() {
fi
fi
marker_pids=$(pgrep -f "$APP_MARKER" 2>/dev/null || true)
marker_pids=$(ps -ef | awk -v marker="$APP_MARKER" -v jar="$JAR_NAME" '
index($0, "<defunct>") == 0 && index($0, marker) > 0 {
for (i = 1; i < NF; i++) {
if ($i == "-jar" && $(i + 1) == jar) {
print $2
break
}
}
}
' | xargs 2>/dev/null || true)
if [ -n "${marker_pids:-}" ]; then
for pid in $marker_pids; do
if is_managed_backend_pid "$pid"; then
@@ -225,7 +234,6 @@ restart_action() {
main() {
ensure_command mvn
ensure_command lsof
ensure_command pgrep
ensure_command ps
ensure_command tail