Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upgrade: Make upgrade-postgres work without systemctl.

Alex Vandiver918fcb9f6f4d
diff --git a/scripts/setup/upgrade-postgres b/scripts/setup/upgrade-postgres
index d3ab32b317d..62450e00846 100755
--- a/scripts/setup/upgrade-postgres
+++ b/scripts/setup/upgrade-postgres
@@ -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"