-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Elastic Agent] Fix agent control socket path to always be less than 107 characters #20426
[Elastic Agent] Fix agent control socket path to always be less than 107 characters #20426
Conversation
Pinging @elastic/ingest-management (Team:Ingest Management) |
💚 Build SucceededExpand to view the summary
Build stats
Steps errorsExpand to view the steps failures
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this should be fine,
tmp should be there but in case it is not maybe it would be better to use os.TempDir
|
…107 characters (elastic#20426) * Fix agent control socket path to always be less than 107 characters. * Use os.TempDir. * Don't use os.TempDir.
…enroll CLI commands (#20431) * [Elastic Agent] Improve version, restart, enroll CLI commands (#20359) * Add improve version CLI cmd. * Add new restart cmd. Perform restart at end of enroll. * Fix yaml annotations on version struct. * Fix control.Address on Windows. * Fix control.Address on Windows. * Fix windows dialer. * Fix control.Address on Windows. * Add to CHANGELOG. * Review cleanups. * Fix go vet. * Update talking to communicating. (cherry picked from commit 77b3b07) * [Elastic Agent] Fix agent control socket path to always be less than 107 characters (#20426) * Fix agent control socket path to always be less than 107 characters. * Use os.TempDir. * Don't use os.TempDir.
…ne-2.0 * upstream/master: [docs] Promote ingest management to beta (elastic#20295) Upgrade elasticsearch client library used in tests (elastic#20405) Disable logging when pulling on python integration tests (elastic#20397) Remove pillow from testing requirements.txt (elastic#20407) [Filebeat][ATP Module]Setting user agent field required by the API (elastic#20440) [Ingest Manager] Send datastreams fields (elastic#20402) Add event.ingested to all Filebeat modules (elastic#20386) [Elastic Agent] Fix agent control socket path to always be less than 107 characters (elastic#20426) Improve cgroup_regex docs with examples (elastic#20425) Makes `metrics` config option required in app_insights (elastic#20406) Ensure install scripts only install if needed (elastic#20349) Update container name for the azure filesets (elastic#19899) Group same timestamp metrics values in app_insights metricset (elastic#20403) add_process_metadata processor adds container id even if process metadata not accessible (elastic#19767) Support "cluster" scope in Metricbeat elasticsearch module (elastic#18547) [Filebeat][SophosXG Module] Renaming module and fileset (elastic#20396) Update Suricata dashboards (elastic#20394) [Elastic Agent] Improve version, restart, enroll CLI commands (elastic#20359) Prepare home directories for docker images in a different stage (elastic#20356)
…allation * upstream/master: (23 commits) [docs] Promote ingest management to beta (elastic#20295) Upgrade elasticsearch client library used in tests (elastic#20405) Disable logging when pulling on python integration tests (elastic#20397) Remove pillow from testing requirements.txt (elastic#20407) [Filebeat][ATP Module]Setting user agent field required by the API (elastic#20440) [Ingest Manager] Send datastreams fields (elastic#20402) Add event.ingested to all Filebeat modules (elastic#20386) [Elastic Agent] Fix agent control socket path to always be less than 107 characters (elastic#20426) Improve cgroup_regex docs with examples (elastic#20425) Makes `metrics` config option required in app_insights (elastic#20406) Ensure install scripts only install if needed (elastic#20349) Update container name for the azure filesets (elastic#19899) Group same timestamp metrics values in app_insights metricset (elastic#20403) add_process_metadata processor adds container id even if process metadata not accessible (elastic#19767) Support "cluster" scope in Metricbeat elasticsearch module (elastic#18547) [Filebeat][SophosXG Module] Renaming module and fileset (elastic#20396) Update Suricata dashboards (elastic#20394) [Elastic Agent] Improve version, restart, enroll CLI commands (elastic#20359) Prepare home directories for docker images in a different stage (elastic#20356) New multiline mode in Filebeat: while_pattern (elastic#19662) ...
…107 characters (elastic#20426) * Fix agent control socket path to always be less than 107 characters. * Use os.TempDir. * Don't use os.TempDir.
What does this PR do?
Instead of placing the control socket inside the
paths.Data()
it moves it to be under/tmp/elastic-agent-{$ hash_of(paths.Data()) $}.sock
. That ensure that the path will always be less than 107 characters, but be unique per Elastic Agent data path.I was original could to change it to the
/run
directory but that has permission issues, that would always required Elastic Agent to run as root, and we do not want to make that a requirement.Why is it important?
So that running Elastic Agent when it is nested deep into multiple directories doesn't cause an issue with the socket path being longer than 107 characters.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added tests that prove my fix is effective or that my feature works[ ] I have added an entry inCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.