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

(cherry picked from commit 31f27ce)
  • Loading branch information
russcam committed May 19, 2020
1 parent cda4be8 commit 4e82e90
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

0 comments on commit 4e82e90

Please sign in to comment.