upgrade: Make upgrade-postgres work without systemctl.

The only postgres cluster which need be stopped is the one we are
upgrading.
This commit is contained in:
Alex Vandiver 2020-06-27 03:28:59 +00:00 committed by Tim Abbott
parent 2540b678b0
commit 918fcb9f6f
1 changed files with 3 additions and 3 deletions

View File

@ -24,16 +24,16 @@ if pg_lsclusters -h | grep -qE "^$UPGRADE_TO\s+main\b"; then
fi
# Work around `systemctl stop postgresql` being asynchronous, since
# the pg_upsgrdecluster command fails if it is still running
# the pg_upgradecluster command fails if it is still running
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759725
systemctl stop postgresql "postgresql@*"
pg_ctlcluster "$UPGRADE_FROM" main stop
pg_upgradecluster "$UPGRADE_FROM" main
crudini --set /etc/zulip/zulip.conf postgresql version "$UPGRADE_TO"
touch "/usr/share/postgresql/$UPGRADE_TO/pgroonga_setup.sql.applied"
"$ZULIP_PATH"/scripts/zulip-puppet-apply -f
systemctl restart memcached
service memcached restart
pg_dropcluster "$UPGRADE_FROM" main
apt remove -y "postgresql-$UPGRADE_FROM"