Skip to content

Commit

Permalink
Fix Windows parameters and typo
Browse files Browse the repository at this point in the history
  • Loading branch information
rnishtala-sumo authored and fguimond committed Feb 1, 2024
1 parent 867b341 commit 33cb900
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion otelcolbuilder/cmd/main_windows.go.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- ./main_windows.go
+++ ./main_windows.go.patched
@@ -17,7 +17,11 @@ import (
@@ -17,7 +17,14 @@ import (
func run(params otelcol.CollectorSettings) error {
// No need to supply service name when startup is invoked through
// the Service Control Manager directly.
Expand All @@ -9,6 +9,9 @@
+ if err != nil {
+ return err
+ }
+ cmd := otelcol.NewCommand(params)
+ // this is only here so that the flag can be recognized by the upstream parser and displayed in help
+ cmd.Flags().StringVarP(&opAmpConfig, "remote-config", "", "", "path to opamp config file")
+ if err := svc.Run("", 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
Expand Down
2 changes: 1 addition & 1 deletion packaging/msi/wix/components.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<Environment Id="PATH" Name="PATH" Value="[INSTALLDIR]\bin" Permanent="yes" Part="last" Action="set" System="yes" />

<!-- Add service for OTC -->
<ServiceInstall Id="Sevice" Name="!(loc.ServiceName)" DisplayName="!(loc.ServiceDisplayName)" Description="!(loc.ServiceDescription)" Type="ownProcess" Vital="yes" Start="auto" Account="LocalSystem" ErrorControl="normal" Arguments="[SERVICEARGUMENTS]" Interactive="no" />
<ServiceInstall Id="Service" Name="!(loc.ServiceName)" DisplayName="!(loc.ServiceDisplayName)" Description="!(loc.ServiceDescription)" Type="ownProcess" Vital="yes" Start="auto" Account="LocalSystem" ErrorControl="normal" Arguments="[SERVICEARGUMENTS]" Interactive="no" />

<!-- Start/Stop/Remove OTC service -->
<ServiceControl Id="StartServiceControl" Name="!(loc.ServiceName)" Start="install" Stop="both" Remove="uninstall" Wait="no" />
Expand Down

0 comments on commit 33cb900

Please sign in to comment.