From 974159ec944aa407ec9d2ac39e7e03be265d3af1 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Thu, 14 Nov 2013 18:40:23 -0500 Subject: [PATCH] Move apache2 restart for SSO sites to restart-server (imported from commit f999e2b0591a11442c1d3fdba2393ecf6e78bad3) --- scripts/lib/upgrade-zulip-stage-2 | 5 ----- scripts/restart-server | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2 index 6aa0eae22a..4061ba9900 100755 --- a/scripts/lib/upgrade-zulip-stage-2 +++ b/scripts/lib/upgrade-zulip-stage-2 @@ -39,8 +39,3 @@ logging.info("Restarting Zulip...") subprocess.check_call(["cp", "-rT", os.path.join(deploy_path, 'prod-static/serve'), '/home/zulip/prod-static'], preexec_fn=su_to_zulip) subprocess.check_output(["./scripts/restart-server"], preexec_fn=su_to_zulip) - -using_sso = subprocess.check_output(['./bin/get-django-setting', 'USING_SSO'], preexec_fn=su_to_zulip) -if using_sso: - logging.info("Restarting Apache...") - subprocess.check_call(["service", "apache2", "restart"]) diff --git a/scripts/restart-server b/scripts/restart-server index 578d19c046..acc17a359e 100755 --- a/scripts/restart-server +++ b/scripts/restart-server @@ -31,5 +31,10 @@ subprocess.check_call(["supervisorctl", "stop", "zulip-workers:* zulip-django zu subprocess.check_call(["ln", '-nsf', deploy_path, os.path.join(DEPLOYMENTS_DIR, "current")]) subprocess.check_call(["supervisorctl", "start", "zulip-tornado zulip-django zulip-workers:*"]) +using_sso = subprocess.check_output(['./bin/get-django-setting', 'USING_SSO']) +if using_sso.strip() == 'True': + logging.info("Restarting Apache WSGI process...") + subprocess.check_call(["pkill", "-f", "apache2", "-u", "zulip"]) + logging.info("Done!") print OKGREEN + "Application restarted successfully!" + ENDC