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.

scripts: Only stop/restart zulip_deliver_scheduled_* processes if known.

Alex Vandiver16691110a6b1
diff --git a/scripts/restart-server b/scripts/restart-server
index b1065d5981b..0e3fa0313a1 100755
--- a/scripts/restart-server
+++ b/scripts/restart-server
@@ -80,11 +80,16 @@ if has_application_server():
workers.extend(list_supervisor_processes("zulip-workers:*"))
if has_application_server(once=True):
+ # These used to be included in "zulip-workers:*"; since we may
+ # be restarting an older version of Zulip, which has not
+ # applied puppet to reload the new list of processes, only
+ # stop them if they currently exist according to
+ # `supervisorctl`.
workers.extend(
- [
+ list_supervisor_processes(
"zulip_deliver_scheduled_emails",
"zulip_deliver_scheduled_messages",
- ]
+ )
)
if has_process_fts_updates():
diff --git a/scripts/stop-server b/scripts/stop-server
index 5cf9f7f2397..6de4def2dc3 100755
--- a/scripts/stop-server
+++ b/scripts/stop-server
@@ -13,6 +13,7 @@ from scripts.lib.zulip_tools import (
WARNING,
has_application_server,
has_process_fts_updates,
+ list_supervisor_processes,
)
deploy_path = os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
@@ -41,11 +42,15 @@ if has_application_server():
services.extend(["zulip-tornado", "zulip-tornado:*"])
services.append("zulip-workers:*")
if has_application_server(once=True):
+ # These used to be included in "zulip-workers:*"; since we may
+ # be stopping an older version of Zulip, which has not applied
+ # puppet to reload the new list of processes, only stop them
+ # if they currently exist according to `supervisorctl`.
services.extend(
- [
+ list_supervisor_processes(
"zulip_deliver_scheduled_emails",
"zulip_deliver_scheduled_messages",
- ]
+ ),
)
subprocess.check_call(["supervisorctl", "stop", *services])