Restart ES after keystore upgrade in postinst (#84224)

Closes #82433. If the environment variable `RESTART_ON_UPGRADE` is true,
then ensure that we delay restarting Elasticseach until after the
keystore is upgraded, or else we can run into permissions problems.
This commit is contained in:
Rory Hunter 2022-02-24 09:23:51 +00:00 committed by Rory Hunter
parent 6c6721e0ac
commit fb5b44c522
3 changed files with 40 additions and 9 deletions

View file

@ -122,15 +122,6 @@ if [ "x$IS_UPGRADE" != "xtrue" ]; then
echo " sudo systemctl start elasticsearch.service"
fi
set -e
elif [ "$RESTART_ON_UPGRADE" = "true" ]; then
echo -n "Restarting elasticsearch service..."
if command -v systemctl >/dev/null; then
systemctl daemon-reload
systemctl restart elasticsearch.service || true
fi
echo " OK"
fi
# the equivalent code for rpm is in posttrans
@ -149,4 +140,14 @@ if [ "$PACKAGE" = "deb" ]; then
fi
fi
if [ "$RESTART_ON_UPGRADE" = "true" ]; then
echo -n "Restarting elasticsearch service..."
if command -v systemctl >/dev/null; then
systemctl daemon-reload
systemctl restart elasticsearch.service || true
fi
echo " OK"
fi
@scripts.footer@