Skip to content

Commit e3d86ba

Browse files
authored
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 <[email protected]>
1 parent 23d6045 commit e3d86ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

distribution/src/bin/opensearch-env

+3-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ fi
7878

7979
export HOSTNAME=$HOSTNAME
8080

81-
${source.path.env}
81+
if [ -z "$OPENSEARCH_PATH_CONF" ]; then
82+
${source.path.env}
83+
fi
8284

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

0 commit comments

Comments
 (0)