nixpkgs/pkgs/servers/search/elasticsearch/es-home.patch
2014-02-14 18:35:21 +02:00

39 lines
1.1 KiB
Diff

diff --git a/bin/elasticsearch b/bin/elasticsearch
index c7c9263..0fcecf6 100755
--- a/bin/elasticsearch
+++ b/bin/elasticsearch
@@ -76,7 +76,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 --git a/bin/plugin b/bin/plugin
index a8c796a..daf7b99 100755
--- a/bin/plugin
+++ b/bin/plugin
@@ -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 -Xmx64m -Xms16m -Delasticsearch -Des.path.home="$ES_HOME" $properties -cp "$ES_HOME/lib/*" org.elasticsearch.plugins.PluginManager $args
+exec $JAVA $JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home="$ES_HOME" $properties -cp "$ES_CLASSPATH/lib/*" org.elasticsearch.plugins.PluginManager $args