From 6736b35f5f2a5356d49a4fc9760a4464454dec44 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 26 Apr 2022 14:51:18 -0700 Subject: [PATCH] =?UTF-8?q?puppet:=20=E2=80=98supervisorctl=20stop=20all?= =?UTF-8?q?=E2=80=99=20before=20restarting=20Supervisor.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a failure of the 3.4 upgrade test running on Ubuntu 20.04 with Supervisor 4. Signed-off-by: Anders Kaseorg (cherry picked from commit a7e6cb7705dccfd8770587cfe9899bd45f8bb4d8) --- puppet/zulip/manifests/common.pp | 18 +++++++++++++----- puppet/zulip/manifests/supervisor.pp | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/puppet/zulip/manifests/common.pp b/puppet/zulip/manifests/common.pp index 9d8ddcfd8b..7a6d0e699f 100644 --- a/puppet/zulip/manifests/common.pp +++ b/puppet/zulip/manifests/common.pp @@ -8,11 +8,19 @@ class zulip::common { $supervisor_system_conf_dir = '/etc/supervisor/conf.d' $supervisor_conf_file = '/etc/supervisor/supervisord.conf' $supervisor_service = 'supervisor' - $supervisor_start = '/etc/init.d/supervisor start' - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=877086 - # "restart" is actually "stop" under sysvinit - $supervisor_reload = '/etc/init.d/supervisor restart && (/etc/init.d/supervisor start || /bin/true) && /etc/init.d/supervisor status' - $supervisor_status = '/etc/init.d/supervisor status' + $supervisor_start = '/usr/sbin/service supervisor start' + $supervisor_reload = @(EOT) + # The init script's timeout waiting for supervisor is shorter + # than supervisor's timeout waiting for its programs, so we need + # to ask supervisor to stop its programs first. + supervisorctl stop all && + service supervisor restart && + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=877086 + # "restart" is actually "stop" under sysvinit + { service supervisor start || true; } && + service supervisor status + | EOT + $supervisor_status = '/usr/sbin/service supervisor status' } 'RedHat': { $nagios_plugins = 'nagios-plugins' diff --git a/puppet/zulip/manifests/supervisor.pp b/puppet/zulip/manifests/supervisor.pp index 2c9b0740ac..29cb273c83 100644 --- a/puppet/zulip/manifests/supervisor.pp +++ b/puppet/zulip/manifests/supervisor.pp @@ -91,6 +91,7 @@ class zulip::supervisor { } exec { 'supervisor-restart': refreshonly => true, + provider => shell, command => $zulip::common::supervisor_reload, require => Service[$supervisor_service], }