From a7c2dd6f59f9105e81a14586a021f9f58daeee9e Mon Sep 17 00:00:00 2001 From: claude_dev Date: Wed, 26 Aug 2026 22:49:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20vps=5Frestart=5Fresident=20schtasks?= =?UTF-8?q?=20/run=20=E5=8A=A03=E6=AC=A1=E9=87=8D=E8=AF=95=E2=80=94?= =?UTF-8?q?=E2=80=94run756=E5=AE=9E=E9=94=A4=E4=B8=89=E8=BF=9E=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E7=9F=AD=E6=97=B6=E6=B5=B7=E9=87=8Fssh=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E5=8F=AF=E8=A2=ABsshd=E5=8D=95=E5=8F=91=E9=87=8D?= =?UTF-8?q?=E7=BD=AE(kex=20reset),=E6=8B=89=E8=B5=B7=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E6=B2=A1=E9=80=81=E5=88=B0=3D=E5=BD=B1=E5=AD=90=E8=88=B0?= =?UTF-8?q?=E9=98=9F=E6=95=B4=E5=A4=9C=E9=9D=99=E9=BB=98=E9=9C=80=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E8=A1=A5=E6=8B=89=20[nas]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/nas_sync/vps_restart_resident.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/nas_sync/vps_restart_resident.sh b/scripts/nas_sync/vps_restart_resident.sh index a933f22..8619241 100644 --- a/scripts/nas_sync/vps_restart_resident.sh +++ b/scripts/nas_sync/vps_restart_resident.sh @@ -36,8 +36,20 @@ $SSH "schtasks /end /tn sanguo-shadow-desk" 2>/dev/null || true # ---- 4) 重拉 ---- sleep 3 -$SSH "schtasks /run /tn sanguo-live-supervisor" || { echo "❌ supervisor 拉起失败"; exit 1; } -$SSH "schtasks /run /tn sanguo-shadow-desk" || { echo "❌ shadow-desk 拉起失败"; exit 1; } +# schtasks /run 带重试(2026-08-26 run756 实锤: 短时海量 ssh 连接可被 sshd 重置 +# `kex_exchange_identification: Connection reset`——单发失败=影子舰队整夜静默, +# 需手动 schtasks /run 补拉; 3 次重试吃掉瞬时抖动) +run_task() { + local tn=$1 i + for i in 1 2 3; do + $SSH "schtasks /run /tn $tn" && return 0 + echo " (拉起 $tn 第${i}次失败, 5s 后重试)" + sleep 5 + done + return 1 +} +run_task sanguo-live-supervisor || { echo "❌ supervisor 拉起失败"; exit 1; } +run_task sanguo-shadow-desk || { echo "❌ shadow-desk 拉起失败"; exit 1; } # ---- 5) 等进程回来(内存实测 40-60s 起齐,给 120s 余量)---- for i in $(seq 1 12); do