From 0f905e9b00b0d81c51ac17bbfeadba7ae6db9fa3 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Fri, 25 Sep 2015 23:55:54 -0400 Subject: [PATCH] CLI: Don't let ubuntu try to install its crazy jayatana agent. See https://github.com/elastic/elasticsearch/pull/13813 This is the corresponding workaround for x-plugins commandline tools. Closes elastic/elasticsearch#719 Original commit: elastic/x-pack-elasticsearch@c607fd219735d012b59f24368d606909b1431046 --- elasticsearch/x-pack/shield/bin/xpack/esusers | 8 ++++++++ elasticsearch/x-pack/shield/bin/xpack/syskeygen | 8 ++++++++ elasticsearch/x-pack/watcher/bin/xpack/croneval | 10 +++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/elasticsearch/x-pack/shield/bin/xpack/esusers b/elasticsearch/x-pack/shield/bin/xpack/esusers index 50d7d522c34..732e9d0c8a8 100755 --- a/elasticsearch/x-pack/shield/bin/xpack/esusers +++ b/elasticsearch/x-pack/shield/bin/xpack/esusers @@ -125,6 +125,14 @@ export HOSTNAME=`hostname -s` # include shield jars in classpath ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" +# don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu) +# works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487 +if [ "x$JAVA_TOOL_OPTIONS" != "x" ]; then + echo "Warning: Ignoring JAVA_TOOL_OPTIONS=$JAVA_TOOL_OPTIONS" + echo "Please pass JVM parameters via ES_JAVA_OPTS instead" + unset JAVA_TOOL_OPTIONS +fi + cd "$ES_HOME" > /dev/null "$JAVA" $ES_JAVA_OPTS -cp "$ES_CLASSPATH" -Des.path.home="$ES_HOME" $properties org.elasticsearch.shield.authc.esusers.tool.ESUsersTool "$@" status=$? diff --git a/elasticsearch/x-pack/shield/bin/xpack/syskeygen b/elasticsearch/x-pack/shield/bin/xpack/syskeygen index 6f29cb744b8..be326789b11 100755 --- a/elasticsearch/x-pack/shield/bin/xpack/syskeygen +++ b/elasticsearch/x-pack/shield/bin/xpack/syskeygen @@ -125,6 +125,14 @@ export HOSTNAME=`hostname -s` # include shield jars in classpath ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" +# don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu) +# works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487 +if [ "x$JAVA_TOOL_OPTIONS" != "x" ]; then + echo "Warning: Ignoring JAVA_TOOL_OPTIONS=$JAVA_TOOL_OPTIONS" + echo "Please pass JVM parameters via ES_JAVA_OPTS instead" + unset JAVA_TOOL_OPTIONS +fi + cd "$ES_HOME" > /dev/null $JAVA $ES_JAVA_OPTS -cp "$ES_CLASSPATH" -Des.path.home="$ES_HOME" $properties org.elasticsearch.shield.crypto.tool.SystemKeyTool "$@" status=$? diff --git a/elasticsearch/x-pack/watcher/bin/xpack/croneval b/elasticsearch/x-pack/watcher/bin/xpack/croneval index 228f4233760..c2561b29245 100755 --- a/elasticsearch/x-pack/watcher/bin/xpack/croneval +++ b/elasticsearch/x-pack/watcher/bin/xpack/croneval @@ -116,8 +116,16 @@ export HOSTNAME=`hostname -s` # include watcher jars in classpath ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" +# don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu) +# works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487 +if [ "x$JAVA_TOOL_OPTIONS" != "x" ]; then + echo "Warning: Ignoring JAVA_TOOL_OPTIONS=$JAVA_TOOL_OPTIONS" + echo "Please pass JVM parameters via ES_JAVA_OPTS instead" + unset JAVA_TOOL_OPTIONS +fi + cd "$ES_HOME" > /dev/null $JAVA $ES_JAVA_OPTS -cp "$ES_CLASSPATH" org.elasticsearch.watcher.trigger.schedule.tool.CronEvalTool "$@" $properties status=$? cd - > /dev/null -exit $status \ No newline at end of file +exit $status