Cherry-pick #19205 to 7.x: [Elastic Agent] Support an application spec to be ran through service manager (eg. Endpoint) #19487
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.
Cherry-pick of PR #19205 to 7.x branch. Original message:
What does this PR do?
This splits the
pkg/core/plugin/app
into 2 distinct types of application typesprocess
(which runs the application as a subprocess and passes the connection credentials through stdin) andservice
(which runs the application as it is started by the service manager on the system and passes the connection credentials over a TCP socket defined in the spec file withservice: {port_number}
.This updates the
endpoint.spec
file to setservice: 6788
so that thepkg/core/plugin/service.Application
will start the TCP connections credentials socket on 6788.This also moves some modules around outside of
pkg/core/plugin
to justpkg/core
keepingpkg/core/plugin/*
for the different application types. This also allows for better code re-use in some areas, as the 2 types have lots in common.This currently has a pre-req on #19171, so it shows in this diff.
Why is it important?
To enable support for Elastic Agent to control Endpoint as a service that is installed on the same machine.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have added an entry inCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.