Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Pass config directory to JvmOptionsParser (#368)
Browse files Browse the repository at this point in the history
Relates: elastic/elasticsearch#51882

With the introduction of jvm.options.d directory for customizing
jvm.options, the config directory path is now passed to jvm.options
parser tool instead of the jvm.options path. See the elasticsearch.bat
change for comparison:

https://github.com/elastic/elasticsearch/pull/51882/files#diff-6c06e8a0d0742dc053b8afcbfb2b4201R76

Fixes #363
  • Loading branch information
russcam committed May 19, 2020
1 parent bc6af61 commit 31f27ce
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,9 @@ protected sealed override IEnumerable<string> CreateObservableProcessArguments(I

if (!this.JavaVersionChecker.Start(null, out var javaVersionOut))
throw new StartupException($"Invalid Java version reported: {javaVersionOut}");

var jvmOptionsFile = Path.Combine(this.ConfigDirectory, "jvm.options");
if (!this.JvmOptionsParser.Start(new [] { $"\"{jvmOptionsFile}\"" }, out var jvmOptionsLine) || string.IsNullOrWhiteSpace(jvmOptionsLine))
throw new StartupException($"Could not evaluate jvm.options file: {jvmOptionsFile} result: {jvmOptionsLine}");

if (!this.JvmOptionsParser.Start(new [] { $"\"{this.ConfigDirectory}\"" }, out var jvmOptionsLine) || string.IsNullOrWhiteSpace(jvmOptionsLine))
throw new StartupException($"Could not evaluate jvm.options file. result: {jvmOptionsLine}");
jvmOptionsLine = jvmOptionsLine.Replace("${ES_TMPDIR}", this.PrivateTempDirectory).Replace("\n", "").Replace("\r", "");

return new []
Expand Down

2 comments on commit 31f27ce

@reighnman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible to build a new release with this fix?

@russcam
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reighnman unfortunately, there won't be a new 7.7.0 release with this fix. I'll document a workaround for 7.7.0 in #363

Please sign in to comment.