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.

upgrade-postgresql: Do not remove other supervisor configs.

Alex Vandiverfaf71eea41fb
diff --git a/docs/production/upgrade-or-modify.md b/docs/production/upgrade-or-modify.md
index a1619f66073..4435fd45f0f 100644
--- a/docs/production/upgrade-or-modify.md
+++ b/docs/production/upgrade-or-modify.md
@@ -480,22 +480,34 @@ To upgrade the version of PostgreSQL on the Zulip server:
1. Upgrade your server to the latest Zulip release (at least 3.0).
-2. Stop the server and take a backup:
+1. Stop the server, as the `zulip` user:
+
+ ```bash
+ # On Zulip before 4.0, use `supervisor stop all` instead
+ /home/zulip/deployments/current/scripts/stop-server
+ ```
+
+1. Take a backup, in case of any problems:
```bash
- supervisorctl stop all
/home/zulip/deployments/current/manage.py backup --output=/home/zulip/postgresql-upgrade.backup.tar.gz
```
-3. As root, run the database upgrade tool:
+1. As root, run the database upgrade tool:
```bash
/home/zulip/deployments/current/scripts/setup/upgrade-postgresql
```
-`upgrade-postgresql` will have finished by restarting your Zulip server;
-you should now be able to navigate to its URL and confirm everything
-is working correctly.
+1. As the `zulip` user, start the server again:
+
+ ```bash
+ # On Zulip before 4.0, use `restart-server` instead of `start-server` instead
+ /home/zulip/deployments/current/scripts/start-server
+ ```
+
+You should now be able to navigate to the Zulip server's URL and
+confirm everything is working correctly.
## Modifying Zulip
diff --git a/puppet/zulip/manifests/supervisor.pp b/puppet/zulip/manifests/supervisor.pp
index 405855b1a75..536c4988802 100644
--- a/puppet/zulip/manifests/supervisor.pp
+++ b/puppet/zulip/manifests/supervisor.pp
@@ -12,12 +12,15 @@ class zulip::supervisor {
}
$conf_dir = $zulip::common::supervisor_conf_dir
+ # lint:ignore:quoted_booleans
+ $should_purge = $facts['leave_supervisor'] != 'true'
+ # lint:endignore
file { $conf_dir:
ensure => 'directory',
require => Package['supervisor'],
owner => 'root',
group => 'root',
- purge => true,
+ purge => $should_purge,
recurse => true,
notify => Service[$supervisor_service],
}
diff --git a/scripts/setup/upgrade-postgresql b/scripts/setup/upgrade-postgresql
index 64fa2509121..61a0f1ae8b8 100755
--- a/scripts/setup/upgrade-postgresql
+++ b/scripts/setup/upgrade-postgresql
@@ -34,7 +34,7 @@ fi
crudini --set "$ZULIP_CONF" machine puppet_classes zulip::profile::base,zulip::postgresql_base
touch "/usr/share/postgresql/$UPGRADE_TO/pgroonga_setup.sql.applied"
- "$ZULIP_PATH"/scripts/zulip-puppet-apply -f --config "$ZULIP_CONF"
+ FACTER_LEAVE_SUPERVISOR=true "$ZULIP_PATH"/scripts/zulip-puppet-apply -f --config "$ZULIP_CONF"
rm -rf "$TEMP_CONF_DIR"
)