Fix packaging scripts references to /etc/elasticsearch

We no longer source the environment file in the packaging scripts yet we
had leftover references to variables defined by those environment
files. This commit cleans these up.
This commit is contained in:
Jason Tedor 2018-03-13 10:07:02 -04:00
parent 3cf599be4c
commit 46e16b68fe
2 changed files with 9 additions and 18 deletions

View File

@ -95,19 +95,15 @@ chown -R root:elasticsearch /etc/elasticsearch
chmod g+s /etc/elasticsearch
chmod 0750 /etc/elasticsearch
if [ -f /etc/default/elasticsearch ]; then
chown root:elasticsearch /etc/default/elasticsearch
if [ -f ${path.env} ]; then
chown root:elasticsearch ${path.env}
fi
if [ -f /etc/sysconfig/elasticsearch ]; then
chown root:elasticsearch /etc/sysconfig/elasticsearch
fi
if [ ! -f "$ES_PATH_CONF"/elasticsearch.keystore ]; then
if [ ! -f /etc/elasticsearch/elasticsearch.keystore ]; then
/usr/share/elasticsearch/bin/elasticsearch-keystore create
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
chown root:elasticsearch /etc/elasticsearch/elasticsearch.keystore
chmod 660 /etc/elasticsearch/elasticsearch.keystore
md5sum /etc/elasticsearch/elasticsearch.keystore > /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum
fi
${scripts.footer}

View File

@ -42,11 +42,6 @@ case "$1" in
;;
esac
ES_ENV_FILE="${path.env}"
if [ -f "$ES_ENV_FILE" ]; then
. "$ES_ENV_FILE"
fi
# Stops the service
if [ "$STOP_REQUIRED" = "true" ]; then
echo -n "Stopping elasticsearch service..."
@ -70,9 +65,9 @@ if [ "$STOP_REQUIRED" = "true" ]; then
echo " OK"
fi
if [ -f "$ES_PATH_CONF"/elasticsearch.keystore ]; then
if md5sum --status -c "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum; then
rm "$ES_PATH_CONF"/elasticsearch.keystore "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum
if [ -f /etc/elasticsearch/elasticsearch.keystore ]; then
if md5sum --status -c /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum; then
rm /etc/elasticsearch/elasticsearch.keystore /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum
fi
fi