Fix opensearch-env always sources the environment from hardcoded file (#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: Xue Zhou <xuezhou@amazon.com>
This commit is contained in:
xuezhou25 2021-07-21 07:51:26 -07:00 committed by GitHub
parent 23d604571c
commit e3d86baa5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -78,7 +78,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"