From ed5ffd6591a06c4e3587979cb985fd9f0dc2850e Mon Sep 17 00:00:00 2001 From: kimchy Date: Sat, 11 Sep 2010 22:22:49 +0300 Subject: [PATCH] Setting `path.work` does not affect the logs location, closes #366. --- .../internal/InternalSettingsPerparer.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/node/internal/InternalSettingsPerparer.java b/modules/elasticsearch/src/main/java/org/elasticsearch/node/internal/InternalSettingsPerparer.java index 43afad1dfbe..f01548b6370 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/node/internal/InternalSettingsPerparer.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/node/internal/InternalSettingsPerparer.java @@ -45,13 +45,6 @@ public class InternalSettingsPerparer { Environment environment = new Environment(settingsBuilder.build()); - // put back the env settings - settingsBuilder = settingsBuilder().put(pSettings); - settingsBuilder.put("path.home", cleanPath(environment.homeFile().getAbsolutePath())); - settingsBuilder.put("path.work", cleanPath(environment.workFile().getAbsolutePath())); - settingsBuilder.put("path.work_with_cluster", cleanPath(environment.workWithClusterFile().getAbsolutePath())); - settingsBuilder.put("path.logs", cleanPath(environment.logsFile().getAbsolutePath())); - if (loadConfigSettings) { try { settingsBuilder.loadFromUrl(environment.resolveConfig("elasticsearch.yml")); @@ -99,6 +92,18 @@ public class InternalSettingsPerparer { settingsBuilder.put(ClusterName.SETTING, ClusterName.DEFAULT.value()); } - return new Tuple(settingsBuilder.build(), environment); + Settings v1 = settingsBuilder.build(); + environment = new Environment(v1); + + // put back the env settings + settingsBuilder = settingsBuilder().put(v1); + settingsBuilder.put("path.home", cleanPath(environment.homeFile().getAbsolutePath())); + settingsBuilder.put("path.work", cleanPath(environment.workFile().getAbsolutePath())); + settingsBuilder.put("path.work_with_cluster", cleanPath(environment.workWithClusterFile().getAbsolutePath())); + settingsBuilder.put("path.logs", cleanPath(environment.logsFile().getAbsolutePath())); + + v1 = settingsBuilder.build(); + + return new Tuple(v1, environment); } }