Commit 96882c99 by Kevin Falcone

Reload nginx earlier in the process

While we test migrations, nginx can serve random hosts to the ELB and
begin serving traffic before lms/cms have linked in and been started by
supervisor.

This should restore the previous behavior where /heartbeat would fail to
connect to the backend when supervisor isn't live yet.
parent 6e498247
......@@ -222,6 +222,12 @@ if __name__ == '__main__':
try:
for service in services_for_instance(instance_id):
if service in NGINX_ENABLE:
subprocess.call(NGINX_ENABLE[service], shell=True)
report.append("Enabling nginx: {}".format(service))
# We have to reload the new config files
subprocess.call("/bin/systemctl reload nginx", shell=True)
if service in MIGRATION_COMMANDS:
services = {
"lms": {'python': args.edxapp_python, 'env_file': args.edxapp_env, 'code_dir': args.edxapp_code_dir},
......@@ -255,12 +261,6 @@ if __name__ == '__main__':
else:
raise Exception("No conf available for service: {}".format(link_location))
if service in NGINX_ENABLE:
subprocess.call(NGINX_ENABLE[service], shell=True)
report.append("Enabling nginx: {}".format(service))
# We have to reload the new config files
subprocess.call("/bin/systemctl reload nginx", shell=True)
except AWSConnectionError as ae:
msg = "{}: ERROR : {}".format(prefix, ae)
if notify:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment