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.

puppet: Explain value of reload && update trick for supervisor.

Alex Vandiver93401448b9b6
diff --git a/puppet/zulip/manifests/supervisor.pp b/puppet/zulip/manifests/supervisor.pp
index d2b35cb4e6b..8e0e33835a4 100644
--- a/puppet/zulip/manifests/supervisor.pp
+++ b/puppet/zulip/manifests/supervisor.pp
@@ -48,19 +48,22 @@ class zulip::supervisor {
],
hasstatus => true,
status => 'supervisorctl status',
- # The "restart" option in the init script does not work. We could
- # tell Puppet to fall back to stop/start, which does work, but the
- # better option is to tell supervisord to reread its config via
- # supervisorctl and then to "update". You need to do both --
- # after a "reread", supervisor won't actually take actual based on
- # the changed configuration until you do an "update" (I assume
- # this is so you can check if your config file parses without
- # doing anything, but it's really confusing)
+ # Restarting the whole supervisorctl on every update to its
+ # configuration files has the unfortunate side-effect of
+ # restarting all of the services it controls; this results in an
+ # unduly large disruption. The better option is to tell
+ # supervisord to reread its config via supervisorctl and then to
+ # "update". You need to do both -- after a "reread", supervisor
+ # won't actually take action based on the changed configuration
+ # until you do an "update" (I assume this is so you can check if
+ # your config file parses without doing anything, but it's
+ # really confusing).
#
- # Also, to handle the case that supervisord wasn't running at all,
- # we check if it is not running and if so, start it.
+ # Also, to handle the case that supervisord wasn't running at
+ # all, we check if it is not running and if so, start it.
#
- # We use supervisor[d] as the pattern so the bash/grep commands don't match.
+ # We use supervisor[d] as the pattern so the bash/grep commands
+ # don't match.
hasrestart => true,
# lint:ignore:140chars
restart => "bash -c 'if pgrep -f supervisor[d] >/dev/null; then supervisorctl reread && supervisorctl update; else ${supervisor_start}; fi'"