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.
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
Autogenerate and print elastic pwd on startup #77291
Autogenerate and print elastic pwd on startup #77291
Changes from 3 commits
7f7b77c
667baff
1789a8e
3b47ec2
12867e4
79a6c21
2b618db
19ccb55
7a328b1
6473ece
8f40211
a9c1b9e
c653951
fdfe14b
a63144b
7f08b9d
f46f815
1c2376c
3277e1a
ccaac5a
6d0c9e4
db255ab
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We could pass a reference to the original stdout PrintStream from Bootstrap to Node and then to the SecurityPlugin's
createComponents
so that we can temporarily callSystem.setOut
to that , print to stdout and revert to log4j afterwards. This needssetIO
RuntimePermission for the security plugin though and I'm not sure how comfortable I am with this change.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 don't understand why you'd need to call
System.setOut
- you just need a reference to thePrintStream
so you can use it.What we need is for
Bootstrap
(or something close to it) to hold on to the original stdout in a place that we can get to it (but is on the forbidden APIs list).Bootstrap
already has code to close original stream if we're not in the foreground, so I think a change to add aSystemConsole
class inorg.elasticsearch.bootstrap
is entirely feasible.Do you want me to pull something together?
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.
Yes, you are right. I misunderstood how we do it ( and how handling stdout works most probably ) in LogConfigurator, and I had presumed the
PrintStream
would be unusable.That would be great