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.

stop-server: Only stop services if they exist and are running.

Alex Vandiver3717c329b8a7
diff --git a/scripts/stop-server b/scripts/stop-server
index 912cf4c761a..ee0c1af9e8c 100755
--- a/scripts/stop-server
+++ b/scripts/stop-server
@@ -42,20 +42,17 @@ if has_application_server():
services.append("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",
- ]
- ),
- )
+ # These used to be included in "zulip-workers:*"; we may be
+ # stopping an older version of Zulip, which has not applied
+ # puppet to reload the new list of processes, but the
+ # list_supervisor_processes below will filter them out if they
+ # do not exist.
+ services.append("zulip_deliver_scheduled_emails")
+ services.append("zulip_deliver_scheduled_messages")
-subprocess.check_call(["supervisorctl", "stop", *services])
+services = list_supervisor_processes(services, only_running=True)
+if services:
+ subprocess.check_call(["supervisorctl", "stop", *services])
print()
print(OKGREEN + "Zulip stopped successfully!" + ENDC)