nixpkgs/pkgs/servers/search/elasticsearch/es-home.patch
2015-08-20 00:18:46 +02:00

37 lines
1.3 KiB
Diff

diff -rupN a/bin/elasticsearch b/bin/elasticsearch
--- a/bin/elasticsearch 2015-08-05 17:52:05.740819671 +0200
+++ b/bin/elasticsearch 2015-08-05 17:22:34.664657364 +0200
@@ -83,7 +83,10 @@ while [ -h "$SCRIPT" ] ; do
done
# determine elasticsearch home
-ES_HOME=`dirname "$SCRIPT"`/..
+if [ -z "$ES_HOME" ]; then
+ echo "You must set the ES_HOME var" >&2
+ exit 1
+fi
# make ELASTICSEARCH_HOME absolute
ES_HOME=`cd "$ES_HOME"; pwd`
diff -rupN a/bin/plugin b/bin/plugin
--- a/bin/plugin 2015-08-05 17:57:07.903088815 +0200
+++ b/bin/plugin 2015-08-05 17:57:38.979808139 +0200
@@ -16,7 +16,10 @@ while [ -h "$SCRIPT" ] ; do
done
# determine elasticsearch home
-ES_HOME=`dirname "$SCRIPT"`/..
+if [ -z "$ES_HOME" ]; then
+ echo "You must set the ES_HOME var" >&2
+ exit 1
+fi
# make ELASTICSEARCH_HOME absolute
ES_HOME=`cd "$ES_HOME"; pwd`
@@ -45,4 +48,4 @@ while [ $# -gt 0 ]; do
shift
done
-exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home="$ES_HOME" $properties -cp "$ES_HOME/lib/*" org.elasticsearch.plugins.PluginManager $args
+exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home="$ES_HOME" $properties -cp "$ES_CLASSPATH/lib/*" org.elasticsearch.plugins.PluginManager $args