Cherry-pick #20111 to 7.x: [Elastic Agent] Add ability to re-exec agent#20267
Cherry-pick #20111 to 7.x: [Elastic Agent] Add ability to re-exec agent#20267blakerouse merged 1 commit intoelastic:7.xfrom
Conversation
* Add ability to reexec on all platforms. * Get it working on Windows * Fix on mac. * Fix vet. * Update ShutdownChan to be receive only. (cherry picked from commit 5a37193)
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
💔 Tests FailedExpand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
Cherry-pick of PR #20111 to 7.x branch. Original message:
What does this PR do?
This adds the ability to re-exec Elastic Agent in the same PID and memory address space (on unix) and with in the same service on Windows (not same PID and address space).
This has been tested on Windows using
SIGINTand Windows services, but theSIGINTcatch is removed in the PR because it cannot be that way truly. Adding a way to perform this on Windows will occur in a follow up branch.Why is it important?
This is one of the steps to self-upgrading the Elastic Agent. This will also be used to allow reloading of the Elastic Agent when a configuration change that does not automatically get applied through the reloader.
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(very hard to unit test)[ ] I have added an entry inCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Author's Checklist
SIGHUPto process will perform shutdown of the application and the re-exec itself.How to test this PR locally
Start the
elastic-agentthen send SIGHUP.