From dd0cf4114713069c11e2a829e0ee90769e399fcf Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Wed, 10 Apr 2024 03:10:59 +0900 Subject: [PATCH] Auto restart Windows agent daemon service (#1819) This enables auto restart of the windows agent daemon service on event of failure --- client/cmd/service_installer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/cmd/service_installer.go b/client/cmd/service_installer.go index da6beef4f..5e147262b 100644 --- a/client/cmd/service_installer.go +++ b/client/cmd/service_installer.go @@ -64,6 +64,10 @@ var installCmd = &cobra.Command{ } } + if runtime.GOOS == "windows" { + svcConfig.Option["OnFailure"] = "restart" + } + ctx, cancel := context.WithCancel(cmd.Context()) s, err := newSVC(newProgram(ctx, cancel), svcConfig)