Skip to content

Commit ed2860e

Browse files
Warn when unable to upgrade keystore on debian (elastic#51011)
For Red Hat RPM upgrades, we warn if we can't upgrade the keystore. This commit brings the same logic to the code for Debian packages. See the posttrans file for gets executed for RPMs.
1 parent 8438a8c commit ed2860e

File tree

1 file changed

+6
-1
lines changed
  • distribution/packages/src/common/scripts

1 file changed

+6
-1
lines changed

distribution/packages/src/common/scripts/postinst

+6-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ if [ "$PACKAGE" = "deb" ]; then
108108
chmod 660 "${ES_PATH_CONF}"/elasticsearch.keystore
109109
md5sum "${ES_PATH_CONF}"/elasticsearch.keystore > "${ES_PATH_CONF}"/.elasticsearch.keystore.initial_md5sum
110110
else
111-
/usr/share/elasticsearch/bin/elasticsearch-keystore upgrade
111+
if /usr/share/elasticsearch/bin/elasticsearch-keystore has-passwd --silent ; then
112+
echo "### Warning: unable to upgrade encrypted keystore" 1>&2
113+
echo " Please run elasticsearch-keystore upgrade and enter password" 1>&2
114+
else
115+
/usr/share/elasticsearch/bin/elasticsearch-keystore upgrade
116+
fi
112117
fi
113118
fi
114119

0 commit comments

Comments
 (0)