From 17e66a7a73a88d5c29c77133cdb5ad5aebd0a4c1 Mon Sep 17 00:00:00 2001 From: Nick O'Connor Date: Tue, 6 Jun 2023 17:40:02 -0700 Subject: [PATCH] fix: Windows service stop (#1833) When the Windows service stops, it immediately spawns a command line instance with the same arguments. This rebinds to the same port(s) and effectively prevents the service from stopping or restarting. --- main_windows.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main_windows.go b/main_windows.go index 1b7bf3d84..1dd1b3454 100644 --- a/main_windows.go +++ b/main_windows.go @@ -111,7 +111,6 @@ func main() { inService, err := svc.IsWindowsService() if err != nil { os.Exit(99) // failed to determine service status - return } // running as service? @@ -119,8 +118,8 @@ func main() { err := svc.Run("cloud-sql-proxy", &windowsService{}) if err != nil { os.Exit(100) // failed to execute service - return } + return } // run as commandline