zulip/scripts
Alex Vandiver 7c4293a7d3 restart-server: Check if service is running before restart, vs start.
In some instances (e.g. during upgrades) we run `restart-server` and
not `start-server`, even though we expect the server to most likely
already be stopped.  `supervisorctl restart servicename` if the
service is stopped produces the perhaps-alarming message:

```
restart-server: Restarting servicename
servicename: ERROR (not running)
servicename: started
```

This may cause operators to worry that something is broken, when it is
not.

Check if the service is already running, and switch from "restart" to
"start" in cases where it is not.

The race condition here is safe -- if the service transitions from
stopped to started between the check and the `start` call, it will
merely output:
```
servicename: ERROR (already started)
```
...and continue, as that has exit status 0.

If the service transitions from started to stopped between the check
and the `restart` call, we are merely back in the current case, where
it outputs:
```
servicename: ERROR (not running)
servicename: started
```

In none of these cases does a call to "restart" fail to result in the
service being stopped and then started.
2022-03-09 14:42:15 -08:00
..
lib install: Desupport Ubuntu 22.04 for now. 2022-03-07 11:46:07 -08:00
nagios python: Replace universal_newlines with text. 2022-01-23 22:16:01 -08:00
setup install: Support Ubuntu 22.04. 2022-02-25 14:49:07 -08:00
README.md docs: Apply bullet style changes from Prettier. 2021-09-08 12:06:24 -07:00
__init__.py
get-django-setting python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
purge-old-deployments zulip_tools: Rename may_be_perform_purging to maybe_perform_purging. 2022-01-12 13:21:35 -08:00
refresh-sharding-and-restart puppet: Remove zulip_deliver_scheduled_* from zulip-workers:*. 2021-06-14 17:12:59 -07:00
restart-server restart-server: Check if service is running before restart, vs start. 2022-03-09 14:42:15 -08:00
start-server scripts: Add a start-server as well. 2021-04-21 10:24:08 -07:00
stop-server supervisor: Add a filter for only(-not)-running. 2022-01-26 12:39:54 -08:00
upgrade-zulip upgrade: Modify upgrade scripts to handle failure. 2021-06-23 08:42:20 -07:00
upgrade-zulip-from-git upgrade: Modify upgrade scripts to handle failure. 2021-06-23 08:42:20 -07:00
zulip-puppet-apply python: Remove default "r" mode for open(). 2021-08-02 15:53:52 -07:00

README.md

This directory contains scripts that:

  • Generally do not require access to Django or the database (those are "management commands"), and thus are suitable to run operationally.

  • Are useful for managing a production deployment of Zulip (many are also used in a Zulip development environment, though development-only scripts live in tools/).

For more details, see https://zulip.readthedocs.io/en/latest/overview/directory-structure.html.