Skip to content

Commit

Permalink
Fix opensearch-env always sources the environment from hardcoded file (
Browse files Browse the repository at this point in the history
…#875)

distribution/bin/opensearch-env always sources the environment from the default environment file /etc/default/opensearch. This is an issue if we want to run multiple instances of OpenSearch on the same host. This change lets users override the default behavior by not sourcing the default environment file in case OPENSEARCH_PATH_CONF  is set.

Signed-off-by: xuezhou25 <85715413+xuezhou25@users.noreply.github.com>
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
xuezhou25 authored and peterzhuamazon committed Apr 14, 2022
1 parent c4c0672 commit 57c3c30
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion distribution/src/bin/opensearch-env
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ fi

export HOSTNAME=$HOSTNAME

${source.path.env}
if [ -z "$OPENSEARCH_PATH_CONF" ]; then
${source.path.env}
fi

if [ -z "$OPENSEARCH_PATH_CONF" ]; then
echo "OPENSEARCH_PATH_CONF must be set to the configuration path"
Expand Down

0 comments on commit 57c3c30

Please sign in to comment.