From 46e16b68feaee112126df0ed2bcd7e78d12a4d57 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 13 Mar 2018 10:07:02 -0400 Subject: [PATCH] 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. --- .../packages/src/common/scripts/postinst | 16 ++++++---------- distribution/packages/src/common/scripts/prerm | 11 +++-------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/distribution/packages/src/common/scripts/postinst b/distribution/packages/src/common/scripts/postinst index 2edd78785f9..abc7c91b81d 100644 --- a/distribution/packages/src/common/scripts/postinst +++ b/distribution/packages/src/common/scripts/postinst @@ -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} diff --git a/distribution/packages/src/common/scripts/prerm b/distribution/packages/src/common/scripts/prerm index f13d23cdc9b..f5cf67ca0b6 100644 --- a/distribution/packages/src/common/scripts/prerm +++ b/distribution/packages/src/common/scripts/prerm @@ -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