From 16650ba2397b6e2a2a0d9f016bbc6ee04eafa251 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 20 Apr 2021 02:21:47 +0000 Subject: [PATCH] upgrade: Call ./scripts/stop-server rather than duplicate the logic. --- scripts/lib/upgrade-zulip-stage-2 | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2 index 510d8b08cc..ac470e1728 100755 --- a/scripts/lib/upgrade-zulip-stage-2 +++ b/scripts/lib/upgrade-zulip-stage-2 @@ -101,19 +101,8 @@ IS_SERVER_UP = True def shutdown_server() -> None: global IS_SERVER_UP - core_server_services = [ - "zulip-django", - "zulip-tornado" if tornado_processes == 1 else "zulip-tornado:*", - ] - worker_services = ["zulip-workers:*"] - # Stop and start thumbor service only if thumbor is installed. - if os.path.exists("/etc/supervisor/conf.d/zulip/thumbor.conf"): - core_server_services.append("zulip-thumbor") - logging.info("Stopping Zulip...") - subprocess.check_call( - ["supervisorctl", "stop", *worker_services, *core_server_services], preexec_fn=su_to_zulip - ) + subprocess.check_call(["./scripts/stop-server"], preexec_fn=su_to_zulip) IS_SERVER_UP = False @@ -273,11 +262,6 @@ if not args.skip_migrations: logging.info("Creating some expensive indexes before starting downtime.") subprocess.check_call(["./manage.py", "create_large_indexes"], preexec_fn=su_to_zulip) -# Now we start shutting down services; we start with -# process-fts-updates, which isn't on the critical serving path. -if os.path.exists("/etc/supervisor/conf.d/zulip/zulip_db.conf"): - subprocess.check_call(["supervisorctl", "stop", "process-fts-updates"], preexec_fn=su_to_zulip) - if (not args.skip_puppet or migrations_needed) and IS_SERVER_UP: # By default, we shut down the service to apply migrations and # Puppet changes, to minimize risk of issues due to inconsistent