Pass config path as a system property

This commit responds to an upstream change which removes the --path.conf
command-line flag and instead uses the replacement mechanism for setting
the configuration path via the system property es.path.conf.

Relates elastic/x-pack-elasticsearch#2113

Original commit: elastic/x-pack-elasticsearch@4fefbffecb
This commit is contained in:
Jason Tedor 2017-07-28 12:15:37 +09:00 committed by GitHub
parent 3a1b64bb12
commit af7ec7a213
7 changed files with 63 additions and 25 deletions

View File

@ -8,11 +8,16 @@ source "`dirname "$0"`"/../elasticsearch-env
source "`dirname "$0"`"/x-pack-env
declare -a args=("$@")
args=("${args[@]}" --path.conf "$CONF_DIR")
cd "$ES_HOME" > /dev/null
"$JAVA" $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" org.elasticsearch.xpack.ssl.CertificateTool "${args[@]}"
"$JAVA" \
$ES_JAVA_OPTS \
-Des.path.home="$ES_HOME" \
-Des.path.conf="$CONF_DIR" \
-cp "$ES_CLASSPATH" \
org.elasticsearch.xpack.ssl.CertificateTool \
"$@"
status=$?
cd - > /dev/null
exit $status

View File

@ -9,7 +9,15 @@ source "`dirname "$0"`"/../elasticsearch-env
source "`dirname "$0"`"/x-pack-env
cd "$ES_HOME" > /dev/null
"$JAVA" $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" org.elasticsearch.xpack.watcher.trigger.schedule.tool.CronEvalTool "$@"
"$JAVA" \
$ES_JAVA_OPTS \
-Des.path.home="$ES_HOME" \
-Des.path.conf="$CONF_DIR" \
-cp "$ES_CLASSPATH" \
org.elasticsearch.xpack.watcher.trigger.schedule.tool.CronEvalTool \
"$@"
status=$?
cd - > /dev/null
exit $status

View File

@ -8,11 +8,16 @@ source "`dirname "$0"`"/../elasticsearch-env
source "`dirname "$0"`"/x-pack-env
declare -a args=("$@")
args=("${args[@]}" --path.conf "$CONF_DIR")
cd "$ES_HOME" > /dev/null
"$JAVA" $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" org.elasticsearch.xpack.extensions.XPackExtensionCli "${args[@]}"
"$JAVA" \
$ES_JAVA_OPTS \
-Des.path.home="$ES_HOME" \
-Des.path.conf="$CONF_DIR" \
-cp "$ES_CLASSPATH" \
org.elasticsearch.xpack.extensions.XPackExtensionCli \
"$@"
status=$?
cd - > /dev/null
exit $status

View File

@ -8,11 +8,16 @@ source "`dirname "$0"`"/../elasticsearch-env
source "`dirname "$0"`"/x-pack-env
declare -a args=("$@")
args=("${args[@]}" --path.conf "$CONF_DIR")
cd "$ES_HOME" > /dev/null
"$JAVA" $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" org.elasticsearch.xpack.security.authc.esnative.ESNativeRealmMigrateTool "${args[@]}"
"$JAVA" \
$ES_JAVA_OPTS \
-Des.path.home="$ES_HOME" \
-Des.path.conf="$CONF_DIR" \
-cp "$ES_CLASSPATH" \
org.elasticsearch.xpack.security.authc.esnative.ESNativeRealmMigrateTool \
"$@"
status=$?
cd - > /dev/null
exit $status

View File

@ -8,11 +8,16 @@ source "`dirname "$0"`"/../elasticsearch-env
source "`dirname "$0"`"/x-pack-env
declare -a args=("$@")
args=("${args[@]}" --path.conf "$CONF_DIR")
cd "$ES_HOME" > /dev/null
"$JAVA" $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" org.elasticsearch.xpack.security.authc.esnative.tool.SetupPasswordTool "${args[@]}"
"$JAVA" \
$ES_JAVA_OPTS \
-Des.path.home="$ES_HOME" \
-Des.path.conf="$CONF_DIR" \
-cp "$ES_CLASSPATH" \
org.elasticsearch.xpack.security.authc.esnative.tool.SetupPasswordTool \
"$@"
status=$?
cd - > /dev/null
exit $status

View File

@ -8,11 +8,16 @@ source "`dirname "$0"`"/../elasticsearch-env
source "`dirname "$0"`"/x-pack-env
declare -a args=("$@")
args=("${args[@]}" --path.conf "$CONF_DIR")
cd "$ES_HOME" > /dev/null
"$JAVA" $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" org.elasticsearch.xpack.security.crypto.tool.SystemKeyTool "${args[@]}"
"$JAVA" \
$ES_JAVA_OPTS \
-Des.path.home="$ES_HOME" \
-Des.path.conf="$CONF_DIR" \
-cp "$ES_CLASSPATH" \
org.elasticsearch.xpack.security.crypto.tool.SystemKeyTool \
"$@"
status=$?
cd - > /dev/null
exit $status

View File

@ -8,11 +8,16 @@ source "`dirname "$0"`"/../elasticsearch-env
source "`dirname "$0"`"/x-pack-env
declare -a args=("$@")
args=("${args[@]}" --path.conf "$CONF_DIR")
cd "$ES_HOME" > /dev/null
"$JAVA" $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" org.elasticsearch.xpack.security.authc.file.tool.UsersTool "${args[@]}"
"$JAVA" \
$ES_JAVA_OPTS \
-Des.path.home="$ES_HOME" \
-Des.path.conf="$CONF_DIR" \
-cp "$ES_CLASSPATH" \
org.elasticsearch.xpack.security.authc.file.tool.UsersTool \
"$@"
status=$?
cd - > /dev/null
exit $status