diff --git a/distribution/src/main/packaging/scripts/postinst b/distribution/src/main/packaging/scripts/postinst index f2bf4c083ce..46610dc8d3e 100644 --- a/distribution/src/main/packaging/scripts/postinst +++ b/distribution/src/main/packaging/scripts/postinst @@ -103,11 +103,17 @@ chown -R root:elasticsearch /etc/elasticsearch chmod 0750 /etc/elasticsearch if [ -f /etc/default/elasticsearch ]; then - chown root:elasticsearch /etc/default/elasticsearch + chown root:elasticsearch /etc/default/elasticsearch fi if [ -f /etc/sysconfig/elasticsearch ]; then - chown root:elasticsearch /etc/sysconfig/elasticsearch + chown root:elasticsearch /etc/sysconfig/elasticsearch +fi + +if [ ! -f "$ES_PATH_CONF"/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 fi ${scripts.footer}