From ae94825b4a1aa3c5a8344beb91a139467352f53b Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Sun, 8 Apr 2018 01:43:47 +0200 Subject: [PATCH] elasticsearch6: fix startup due to missing jvm.options --- nixos/modules/services/search/elasticsearch.nix | 7 +++++-- pkgs/servers/search/elasticsearch/6.x.nix | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/search/elasticsearch.nix b/nixos/modules/services/search/elasticsearch.nix index adef500b7b5c..d61f588205af 100644 --- a/nixos/modules/services/search/elasticsearch.nix +++ b/nixos/modules/services/search/elasticsearch.nix @@ -32,8 +32,11 @@ let (if es5 then (pkgs.writeTextDir "log4j2.properties" cfg.logging) else (pkgs.writeTextDir "logging.yml" cfg.logging)) ]; - # Elasticsearch 5.x won't start when the scripts directory does not exist - postBuild = if es5 then "${pkgs.coreutils}/bin/mkdir -p $out/scripts" else ""; + postBuild = concatStringsSep "\n" (concatLists [ + # Elasticsearch 5.x won't start when the scripts directory does not exist + (optional es5 "${pkgs.coreutils}/bin/mkdir -p $out/scripts") + (optional es6 "ln -s ${cfg.package}/config/jvm.options $out/jvm.options") + ]); }; esPlugins = pkgs.buildEnv { diff --git a/pkgs/servers/search/elasticsearch/6.x.nix b/pkgs/servers/search/elasticsearch/6.x.nix index 60705920d47f..c54cd3800451 100644 --- a/pkgs/servers/search/elasticsearch/6.x.nix +++ b/pkgs/servers/search/elasticsearch/6.x.nix @@ -27,8 +27,7 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/elasticsearch \ --prefix PATH : "${utillinux}/bin/" \ - --set JAVA_HOME "${jre_headless}" \ - --set ES_JVM_OPTIONS "$out/config/jvm.options" + --set JAVA_HOME "${jre_headless}" wrapProgram $out/bin/elasticsearch-plugin --set JAVA_HOME "${jre_headless}" '';