-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerating the patch for main_windows
- Loading branch information
1 parent
6d82290
commit a5f5310
Showing
1 changed file
with
15 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
--- main_windows.go 2022-12-14 15:28:41.207327800 -0800 | ||
+++ main_windows_patched.go 2022-12-14 15:27:42.320825400 -0800 | ||
@@ -41,6 +41,11 @@ | ||
} | ||
|
||
func runService(params otelcol.CollectorSettings) error { | ||
--- main_windows.go | ||
+++ main_windows_patched.go | ||
@@ -16,6 +16,10 @@ import ( | ||
func run(params otelcol.CollectorSettings) error { | ||
// No need to supply service name when startup is invoked through | ||
// the Service Control Manager directly. | ||
+ err := UseCustomConfigProvider(¶ms) | ||
+ if err != nil { | ||
+ return err | ||
+ } | ||
+ | ||
// do not need to supply service name when startup is invoked through Service Control Manager directly | ||
if err := svc.Run("", otelcol.NewSvcHandler(params)); err != nil { | ||
if errors.Is(err, windows.ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) { | ||
// Per https://learn.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-startservicectrldispatchera#return-value | ||
@@ -25,6 +29,7 @@ func run(params otelcol.CollectorSettings) error { | ||
|
||
return fmt.Errorf("failed to start collector server: %w", err) | ||
} | ||
+ | ||
|
||
return nil | ||
} |