fix: rewrite startup scripts with reliable helpers, stderr logging, visible windows
- Replace /MIN (hidden window) with normal windows so errors are visible - Redirect stderr to logs/*.log for post-mortem - Extract killport/wait_health/wait_port into callable helpers - Use !N! (delayed expansion) for retry counters - stop.bat now shows which PIDs it kills with port labels - Remove nested-quote issue by cd'ing before npm start
This commit is contained in:
@@ -1,8 +1,27 @@
|
||||
@echo off
|
||||
chcp 65001 >nul
|
||||
echo [清理] 停止所有 agent_jrxml 服务...
|
||||
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8000.*LISTENING"') do taskkill /F /PID %%a 2>nul
|
||||
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8001.*LISTENING"') do taskkill /F /PID %%a 2>nul
|
||||
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":5173.*LISTENING"') do taskkill /F /PID %%a 2>nul
|
||||
echo ================================================
|
||||
echo 停止所有 agent_jrxml 服务
|
||||
echo ================================================
|
||||
|
||||
echo [停止] 按窗口标题清理...
|
||||
taskkill /F /FI "WINDOWTITLE eq jrxml-validator*" 2>nul
|
||||
taskkill /F /FI "WINDOWTITLE eq jrxml-api*" 2>nul
|
||||
taskkill /F /FI "WINDOWTITLE eq jrxml-frontend*" 2>nul
|
||||
|
||||
echo [停止] 按端口清理...
|
||||
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8000.*LISTENING"') do (
|
||||
echo 端口 8000 - PID %%a
|
||||
taskkill /F /PID %%a >nul 2>&1
|
||||
)
|
||||
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8001.*LISTENING"') do (
|
||||
echo 端口 8001 - PID %%a
|
||||
taskkill /F /PID %%a >nul 2>&1
|
||||
)
|
||||
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":5173.*LISTENING"') do (
|
||||
echo 端口 5173 - PID %%a
|
||||
taskkill /F /PID %%a >nul 2>&1
|
||||
)
|
||||
|
||||
echo 已停止
|
||||
pause
|
||||
|
||||
Reference in New Issue
Block a user