Skip to content

Commit

Permalink
Auto restart Windows agent daemon service (#1819)
Browse files Browse the repository at this point in the history
This enables auto restart of the windows agent daemon service on event of failure
  • Loading branch information
mlsmaycon authored Apr 9, 2024
1 parent 22b2caf commit dd0cf41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/cmd/service_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dd0cf41

Please sign in to comment.