From 75401107134cc6a34e94fdef36d162079d22fc1c Mon Sep 17 00:00:00 2001 From: Conrad Kramer Date: Sun, 19 Apr 2026 14:09:26 -0700 Subject: [PATCH] Wait for Zulip supervisor before nginx patching --- nixos/modules/burrow-zulip.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nixos/modules/burrow-zulip.nix b/nixos/modules/burrow-zulip.nix index 3149a88..9298571 100644 --- a/nixos/modules/burrow-zulip.nix +++ b/nixos/modules/burrow-zulip.nix @@ -455,6 +455,16 @@ EOF } patch_uwsgi_scheme_handling() { + local attempts=0 + while ! podman exec burrow-zulip_zulip_1 supervisorctl status >/dev/null 2>&1; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 90 ]; then + echo "error: Zulip supervisor did not become ready for nginx patching" >&2 + exit 1 + fi + sleep 2 + done + podman exec burrow-zulip_zulip_1 bash -lc "cat > /etc/nginx/uwsgi_params <<'EOF' uwsgi_param QUERY_STRING \$query_string; uwsgi_param REQUEST_METHOD \$request_method; @@ -533,8 +543,8 @@ supervisorctl restart nginx zulip-django >/dev/null" ensure_zulip_data_layout compose up -d zulip - patch_uwsgi_scheme_handling bootstrap_realm_if_needed + patch_uwsgi_scheme_handling ''; }; };