From 73a3428b1d5a8481b8e8149776ca41b04c270ef1 Mon Sep 17 00:00:00 2001 From: Reditus Date: Thu, 14 May 2026 06:17:22 +0100 Subject: [PATCH] fix: run pkill directly via ssh before port-forward --- start.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/start.ps1 b/start.ps1 index 8e8f143..9ecff53 100644 --- a/start.ps1 +++ b/start.ps1 @@ -176,7 +176,8 @@ if ($pfCheck) { } $RemotePort = 15432 -ssh -i $SSHKey -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 ${SSHUser}@${ServerHost} "sudo pkill -f port-forward 2>/dev/null; sleep 2" 2>$null +ssh -i $SSHKey -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 ${SSHUser}@${ServerHost} "sudo pkill -9 -f port-forward 2>/dev/null; sleep 2" 2>$null +Start-Sleep -Seconds 2 $remoteCmd = 'nohup sudo kubectl port-forward -n ' + $Namespace + ' svc/' + $DBService + ' ' + $LocalPort + ':' + $RemotePort + ' > /tmp/pf.log 2>&1 &' $pfRemote = 'ssh -i "' + $SSHKey + '" -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 ' + $SSHUser + '@' + $ServerHost + ' "' + $remoteCmd + '"'