fix: support --remote-config startup option with Windows services #1443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the introduction of remote management the application command line parameters were modified to include the
--remote-config
startup parameter. However this was unintentionally done only for interactive mode. Since the Windows service initialization code uses a different path the new parameter does not work correctly and the application exits.The Windows service launch code path from the upstream repository uses the flags function defined in the upstream code, which doesn't support the
--remote-config
command line parameter. For interactive mode that function was redefined in our implementation of OtelCol to include the--remote-config
command line parameter.This PRs copies the upstream Windows service launch routine and modifies it slightly to use our version of the
args
function instead of the upstream version, making it possible to launch the OtelCol as a Windows server.Testing has been performed by installing a MSI that includes this modified code. The Windows service now launches correctly as illustrated by the Sumo Logic console and Windows Service console.