Skip to content

Commit 46e16b6

Browse files
committed
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.
1 parent 3cf599b commit 46e16b6

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

distribution/packages/src/common/scripts/postinst

+6-10
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,15 @@ chown -R root:elasticsearch /etc/elasticsearch
9595
chmod g+s /etc/elasticsearch
9696
chmod 0750 /etc/elasticsearch
9797

98-
if [ -f /etc/default/elasticsearch ]; then
99-
chown root:elasticsearch /etc/default/elasticsearch
98+
if [ -f ${path.env} ]; then
99+
chown root:elasticsearch ${path.env}
100100
fi
101101

102-
if [ -f /etc/sysconfig/elasticsearch ]; then
103-
chown root:elasticsearch /etc/sysconfig/elasticsearch
104-
fi
105-
106-
if [ ! -f "$ES_PATH_CONF"/elasticsearch.keystore ]; then
102+
if [ ! -f /etc/elasticsearch/elasticsearch.keystore ]; then
107103
/usr/share/elasticsearch/bin/elasticsearch-keystore create
108-
chown root:elasticsearch "$ES_PATH_CONF"/elasticsearch.keystore
109-
chmod 660 "$ES_PATH_CONF"/elasticsearch.keystore
110-
md5sum "$ES_PATH_CONF"/elasticsearch.keystore > "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum
104+
chown root:elasticsearch /etc/elasticsearch/elasticsearch.keystore
105+
chmod 660 /etc/elasticsearch/elasticsearch.keystore
106+
md5sum /etc/elasticsearch/elasticsearch.keystore > /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum
111107
fi
112108

113109
${scripts.footer}

distribution/packages/src/common/scripts/prerm

+3-8
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ case "$1" in
4242
;;
4343
esac
4444

45-
ES_ENV_FILE="${path.env}"
46-
if [ -f "$ES_ENV_FILE" ]; then
47-
. "$ES_ENV_FILE"
48-
fi
49-
5045
# Stops the service
5146
if [ "$STOP_REQUIRED" = "true" ]; then
5247
echo -n "Stopping elasticsearch service..."
@@ -70,9 +65,9 @@ if [ "$STOP_REQUIRED" = "true" ]; then
7065
echo " OK"
7166
fi
7267

73-
if [ -f "$ES_PATH_CONF"/elasticsearch.keystore ]; then
74-
if md5sum --status -c "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum; then
75-
rm "$ES_PATH_CONF"/elasticsearch.keystore "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum
68+
if [ -f /etc/elasticsearch/elasticsearch.keystore ]; then
69+
if md5sum --status -c /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum; then
70+
rm /etc/elasticsearch/elasticsearch.keystore /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum
7671
fi
7772
fi
7873

0 commit comments

Comments
 (0)