diff --git a/distribution/packages/src/common/env/elasticsearch b/distribution/packages/src/common/env/elasticsearch index 76d9473b0fb..5e2b1eb23b2 100644 --- a/distribution/packages/src/common/env/elasticsearch +++ b/distribution/packages/src/common/env/elasticsearch @@ -9,6 +9,7 @@ #JAVA_HOME= # Elasticsearch configuration directory +# Note: this setting will be shared with command-line tools ES_PATH_CONF=${path.conf} # Elasticsearch PID directory diff --git a/distribution/packages/src/common/scripts/postinst b/distribution/packages/src/common/scripts/postinst index d76b9ec7635..98170e122f1 100644 --- a/distribution/packages/src/common/scripts/postinst +++ b/distribution/packages/src/common/scripts/postinst @@ -11,10 +11,10 @@ # source the default env file if [ -f "${path.env}" ]; then . "${path.env}" -else - ES_PATH_CONF="${path.conf}" fi +export ES_PATH_CONF=${ES_PATH_CONF:-${path.conf}} + IS_UPGRADE=false case "$1" in diff --git a/distribution/packages/src/common/scripts/postrm b/distribution/packages/src/common/scripts/postrm index 0b77069603b..9bbdcc78eda 100644 --- a/distribution/packages/src/common/scripts/postrm +++ b/distribution/packages/src/common/scripts/postrm @@ -12,10 +12,10 @@ # source the default env file if [ -f "${path.env}" ]; then . "${path.env}" -else - ES_PATH_CONF="${path.conf}" fi +export ES_PATH_CONF=${ES_PATH_CONF:-${path.conf}} + REMOVE_DIRS=false REMOVE_JVM_OPTIONS_DIRECTORY=false REMOVE_USER_AND_GROUP=false diff --git a/distribution/packages/src/common/scripts/posttrans b/distribution/packages/src/common/scripts/posttrans index 7b072ee2602..d62c24ac34e 100644 --- a/distribution/packages/src/common/scripts/posttrans +++ b/distribution/packages/src/common/scripts/posttrans @@ -1,10 +1,10 @@ # source the default env file if [ -f "${path.env}" ]; then . "${path.env}" -else - ES_PATH_CONF="${path.conf}" fi +export ES_PATH_CONF=${ES_PATH_CONF:-${path.conf}} + if [ ! -f "${ES_PATH_CONF}"/elasticsearch.keystore ]; then /usr/share/elasticsearch/bin/elasticsearch-keystore create chown root:elasticsearch "${ES_PATH_CONF}"/elasticsearch.keystore diff --git a/distribution/packages/src/common/scripts/preinst b/distribution/packages/src/common/scripts/preinst index c3e15b632aa..82eb8458be0 100644 --- a/distribution/packages/src/common/scripts/preinst +++ b/distribution/packages/src/common/scripts/preinst @@ -18,10 +18,10 @@ err_exit() { # source the default env file if [ -f "${path.env}" ]; then . "${path.env}" -else - ES_PATH_CONF="${path.conf}" fi +export ES_PATH_CONF=${ES_PATH_CONF:-${path.conf}} + case "$1" in # Debian #################################################### diff --git a/distribution/packages/src/common/scripts/prerm b/distribution/packages/src/common/scripts/prerm index ff25345963b..df88d8eae4b 100644 --- a/distribution/packages/src/common/scripts/prerm +++ b/distribution/packages/src/common/scripts/prerm @@ -12,10 +12,10 @@ # source the default env file if [ -f "${path.env}" ]; then . "${path.env}" -else - ES_PATH_CONF="${path.conf}" fi +export ES_PATH_CONF=${ES_PATH_CONF:-${path.conf}} + STOP_REQUIRED=false REMOVE_SERVICE=false