diff --git a/distribution/src/main/resources/bin/elasticsearch b/distribution/src/main/resources/bin/elasticsearch index 2d831485a33..88639c502b4 100755 --- a/distribution/src/main/resources/bin/elasticsearch +++ b/distribution/src/main/resources/bin/elasticsearch @@ -121,7 +121,10 @@ case `uname` in ;; esac -export HOSTNAME=`hostname -s` +# full hostname passed through cut for portability on systems that do not support hostname -s +# export on separate line for shells that do not support combining definition and export +HOSTNAME=`hostname | cut -d. -f1` +export HOSTNAME # manual parsing to find out, if process should be detached daemonized=`echo $* | grep -E -- '(^-d |-d$| -d |--daemonize$|--daemonize )'` diff --git a/distribution/src/main/resources/bin/plugin b/distribution/src/main/resources/bin/plugin index 797d8e3a8ff..973d2f6300d 100755 --- a/distribution/src/main/resources/bin/plugin +++ b/distribution/src/main/resources/bin/plugin @@ -103,6 +103,9 @@ if [ -e "$CONF_FILE" ]; then esac fi -export HOSTNAME=`hostname -s` +# full hostname passed through cut for portability on systems that do not support hostname -s +# export on separate line for shells that do not support combining definition and export +HOSTNAME=`hostname | cut -d. -f1` +export HOSTNAME eval "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home="\"$ES_HOME\"" $properties -cp "\"$ES_HOME/lib/*\"" org.elasticsearch.plugins.PluginManagerCliParser $args