Skip to content

Commit

Permalink
Apply /etc/profile in CLI tools
Browse files Browse the repository at this point in the history
Some operating systems may have a shell without default PATH variable
so we apply /etc/profile to set system PATH

Signed-off-by: Alexander Koval <kovalidis@gmail.com>
  • Loading branch information
anti-social committed May 16, 2024
1 parent f217270 commit 1a92df2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions distribution/src/bin/opensearch
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

set -e -o pipefail

source /etc/profile

source "`dirname "$0"`"/opensearch-env

CHECK_KEYSTORE=true
Expand Down
2 changes: 2 additions & 0 deletions distribution/src/bin/opensearch-cli
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e -o pipefail

source /etc/profile

source "`dirname "$0"`"/opensearch-env

IFS=';' read -r -a additional_sources <<< "$OPENSEARCH_ADDITIONAL_SOURCES"
Expand Down
2 changes: 2 additions & 0 deletions distribution/src/bin/opensearch-keystore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e -o pipefail

source /etc/profile

OPENSEARCH_MAIN_CLASS=org.opensearch.common.settings.KeyStoreCli \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/keystore-cli \
"`dirname "$0"`"/opensearch-cli \
Expand Down
3 changes: 3 additions & 0 deletions distribution/src/bin/opensearch-node
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env bash

set -e -o pipefail

source /etc/profile

OPENSEARCH_MAIN_CLASS=org.opensearch.cluster.coordination.NodeToolCli \
"`dirname "$0"`"/opensearch-cli \
"$@"
2 changes: 2 additions & 0 deletions distribution/src/bin/opensearch-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e -o pipefail

source /etc/profile

OPENSEARCH_MAIN_CLASS=org.opensearch.plugins.PluginCli \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/plugin-cli \
"`dirname "$0"`"/opensearch-cli \
Expand Down
2 changes: 2 additions & 0 deletions distribution/src/bin/opensearch-shard
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e -o pipefail

source /etc/profile

OPENSEARCH_MAIN_CLASS=org.opensearch.index.shard.ShardToolCli \
"`dirname "$0"`"/opensearch-cli \
"$@"
3 changes: 3 additions & 0 deletions distribution/src/bin/opensearch-upgrade
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env bash

set -e -o pipefail

source /etc/profile

OPENSEARCH_MAIN_CLASS=org.opensearch.upgrade.UpgradeCli \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/upgrade-cli \
"`dirname "$0"`"/opensearch-cli \
Expand Down

0 comments on commit 1a92df2

Please sign in to comment.