Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect ES_PATH_CONF during upgrades too #50246

Merged
merged 2 commits into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions distribution/packages/src/common/scripts/posttrans
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
if [ ! -f /etc/elasticsearch/elasticsearch.keystore ]; then
# source the default env file
if [ -f "${path.env}" ]; then
. "${path.env}"
else
ES_PATH_CONF="${path.conf}"
fi

if [ ! -f "${ES_PATH_CONF}"/elasticsearch.keystore ]; then
/usr/share/elasticsearch/bin/elasticsearch-keystore create
chown root:elasticsearch /etc/elasticsearch/elasticsearch.keystore
chmod 660 /etc/elasticsearch/elasticsearch.keystore
md5sum /etc/elasticsearch/elasticsearch.keystore > /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum
chown root:elasticsearch "${ES_PATH_CONF}"/elasticsearch.keystore
chmod 660 "${ES_PATH_CONF}"/elasticsearch.keystore
md5sum "${ES_PATH_CONF}"/elasticsearch.keystore > "${ES_PATH_CONF}"/.elasticsearch.keystore.initial_md5sum
else
/usr/share/elasticsearch/bin/elasticsearch-keystore upgrade
fi
Expand Down
7 changes: 7 additions & 0 deletions distribution/packages/src/common/scripts/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ err_exit() {
exit 1
}

# source the default env file
if [ -f "${path.env}" ]; then
. "${path.env}"
else
ES_PATH_CONF="${path.conf}"
fi

case "$1" in

# Debian ####################################################
Expand Down