upgrade-postgresql: Force a known locale.

Some terminals (e.g. ssh from OS X) set an invalid locale, which
causes the `pg_upgradecluster` call late in the upgrade to fail.

Force a known locale, for consistency.  This mirrors the settings in
upgrade-zulip-stage-2, set in 11ab545f3b, and its subsequent
cleanups in 64c608a51a, ee0f4ca330, and eda9ce2364.
This commit is contained in:
Alex Vandiver 2022-12-05 21:06:14 -05:00 committed by Tim Abbott
parent 3a0620a40c
commit 2bbeef301a
1 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,12 @@ if [ "$EUID" -ne 0 ]; then
exit 1
fi
# Force a known locale; some OS X terminals set an invalid LC_CTYPE
# which crashes pg_upgradecluster
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export LANGUAGE=C.UTF-8
UPGRADE_TO=${1:-14}
UPGRADE_FROM=$(crudini --get /etc/zulip/zulip.conf postgresql version)
ZULIP_PATH="$(dirname "$0")/../.."