[Ingest Manager] New Agent structure#20307
[Ingest Manager] New Agent structure#20307michalpristas wants to merge 16 commits intoelastic:masterfrom
Conversation
💔 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
|
| "--path.config", paths.Config(), | ||
| } | ||
| rm := reexec.Manager(rexLogger, reexecPath) | ||
| rm.ReExec(argsOverrides...) |
There was a problem hiding this comment.
I don't think this is really going to work on Windows. being that Windows doesn't support proper re-exec.
Running from Powershell will show this weird behavior, where calling elastic-agent run -e will exit back to the shell but the logs keep printing to the terminal.
Running as a service I looks like it would just be an infinite loop. It would keep restarting the service, and the service would then just keep re-exec, because this same binary would be pointed at by the service.
This is a good approach on Unix based systems, but on Windows I don't believe it will work.
What about the symlink idea? That seems like it would work on all OS types, including Windows: https://golang.org/pkg/syscall/?GOOS=windows#CreateSymbolicLink
There was a problem hiding this comment.
i will need to test it on windows, symlink is ok but needs to be tested as well. we need to create symlink at the build time or provide some activation script, start script or something similar.
i havent tried but i think that creating a symlink during release would not result in something working when you unpack it locally.
03f6559 to
a54ed0a
Compare

What does this PR do?
This PR does a multiple things.
First thing, it alignes structure of resulting package with the proposal defined in issue #20048
For this to work there were a few changes needed.
First one is having two executables one is at root another at
/data/v7.x.x-abc/directory.The one in root serves just as proxy and executes binary in versioned dir and pass all variables there.
This is achieved by pre-run check, check reads the
.build_hash.txtfile if it's there it redirects control to the binary in versioned directory. if it's not there it continues as usual.Draft, because more tests needs to be done
Test on:
Why is it important?
Step 1 for upgradable agent
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.