From 7866869eb6f88e459d3282051bc45665501c4158 Mon Sep 17 00:00:00 2001 From: Reditus <33814724+ReditusDraco@users.noreply.github.com> Date: Thu, 21 May 2026 12:38:29 +0100 Subject: [PATCH] Fix port-forward startup: use sudo fuser to kill stale processes on ports 15433/32479; restore db_check.py for database connectivity check --- launcher.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/launcher.ps1 b/launcher.ps1 index 7f927ef..17e705b 100644 --- a/launcher.ps1 +++ b/launcher.ps1 @@ -1998,6 +1998,7 @@ print(json.dumps(s)) $RemotePort = 15432 Write-Log -Message "Starting port-forward: ${LocalPort}:${RemotePort} on service $DBService" -Category "database" + ssh -i $SSHKey -o StrictHostKeyChecking=accept-new -o ConnectTimeout=10 ${SSHUser}@${ServerHost} "sudo fuser -k ${LocalPort}/tcp ${DirectorPort}/tcp 2>/dev/null; sleep 1" 2>$null $pfCmd = "nohup sudo kubectl port-forward -n $Namespace svc/$DBService $LocalPort`:$RemotePort > /tmp/pf.log 2>`&1 `"&`"" ssh -i $SSHKey -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 "${SSHUser}@${ServerHost}" $pfCmd 2>$null Start-Sleep -Seconds 2 @@ -2172,7 +2173,7 @@ print(json.dumps(s)) Write-Host "" Write-Host "Stopping tunnels..." -ForegroundColor Cyan Stop-Process -Id $sshTunnel.Id -Force -ErrorAction SilentlyContinue - $pkillCmd = 'ssh -i "' + $SSHKey + '" -o StrictHostKeyChecking=accept-new ' + $SSHUser + '@' + $ServerHost + ' "pkill -f kubectl-port-forward"' + $pkillCmd = 'ssh -i "' + $SSHKey + '" -o StrictHostKeyChecking=accept-new ' + $SSHUser + '@' + $ServerHost + ' "sudo fuser -k 15433/tcp 32479/tcp 2>/dev/null"' cmd /c $pkillCmd 2>$null }