From 32118e7c6ca649d0b4fea71d677a56dad7177bfb Mon Sep 17 00:00:00 2001 From: PharmQ Admin Date: Sun, 31 May 2026 01:08:20 +0000 Subject: [PATCH] fix(windows): add service polling + tailscaled fallback to KO script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EN script에만 들어갔던 서비스 폴링/tailscaled 폴백을 한글 스크립트에도 반영. Co-Authored-By: Claude Opus 4.8 (1M context) --- farmq-install.ps1 | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/farmq-install.ps1 b/farmq-install.ps1 index 4143190..de4b351 100644 --- a/farmq-install.ps1 +++ b/farmq-install.ps1 @@ -187,8 +187,14 @@ function Start-TailscaleService { Write-Status "Tailscale 서비스 시작 중..." try { - # Tailscale 서비스 시작 - $service = Get-Service -Name "Tailscale" -ErrorAction SilentlyContinue + # MSI가 "Tailscale" 서비스를 등록한다. 등록까지 몇 초 걸릴 수 있어 폴링한다. + $service = $null + for ($i = 0; $i -lt 15; $i++) { + $service = Get-Service -Name "Tailscale" -ErrorAction SilentlyContinue + if ($service) { break } + Start-Sleep -Seconds 2 + } + if ($service) { if ($service.Status -ne "Running") { Start-Service -Name "Tailscale" @@ -196,7 +202,19 @@ function Start-TailscaleService { } Write-Success "Tailscale 서비스가 실행 중입니다." } else { + # 서비스가 없으면 tailscaled 로 직접 서비스 설치 시도 Write-Warning "Tailscale 서비스를 찾을 수 없습니다. 수동 시작을 시도합니다." + $tailscaled = "C:\Program Files\Tailscale\tailscaled.exe" + if (Test-Path $tailscaled) { + Start-Process -FilePath $tailscaled -ArgumentList "install" -Wait -ErrorAction SilentlyContinue + Start-Sleep -Seconds 3 + $service = Get-Service -Name "Tailscale" -ErrorAction SilentlyContinue + if ($service -and $service.Status -ne "Running") { + Start-Service -Name "Tailscale" -ErrorAction SilentlyContinue + Start-Sleep -Seconds 3 + } + if ($service) { Write-Success "Tailscale 서비스가 실행 중입니다." } + } } } catch {