Skip to content

Commit

Permalink
More portable extraction of short hostname
Browse files Browse the repository at this point in the history
This commit backports the fix #13109 for #13107 to 2.0 from master.
  • Loading branch information
jasontedor committed Aug 25, 2015
1 parent e86aa2e commit 4c08d15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion distribution/src/main/resources/bin/elasticsearch
Expand Up @@ -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 )'`
Expand Down
5 changes: 4 additions & 1 deletion distribution/src/main/resources/bin/plugin
Expand Up @@ -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

0 comments on commit 4c08d15

Please sign in to comment.