From 5a8f28e32105e54c1b251142c4c105fb89bec7da Mon Sep 17 00:00:00 2001 From: Gregg Tanzillo Date: Thu, 11 May 2017 19:44:11 -0400 Subject: [PATCH] Start Apache if roles were changed and it is needed by the current roles Fixes a bug that was introduced in da9523ee2168da89511c9260528c7bb243bfb777 when the Apache load balancer was made static. That removed the code that started Apache up after the role or worker count changed. https://bugzilla.redhat.com/show_bug.cgi?id=1449766 --- app/models/miq_server/environment_management.rb | 4 ++++ app/models/miq_server/worker_management/monitor.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/models/miq_server/environment_management.rb b/app/models/miq_server/environment_management.rb index 9c058a117a9..4c10dfa8b38 100644 --- a/app/models/miq_server/environment_management.rb +++ b/app/models/miq_server/environment_management.rb @@ -121,6 +121,10 @@ def restart_apache MiqApache::Control.restart(false) end + def start_apache + MiqApache::Control.start + end + def stop_apache MiqApache::Control.stop(false) end diff --git a/app/models/miq_server/worker_management/monitor.rb b/app/models/miq_server/worker_management/monitor.rb index f5a3830269e..10f44c057d2 100644 --- a/app/models/miq_server/worker_management/monitor.rb +++ b/app/models/miq_server/worker_management/monitor.rb @@ -148,7 +148,9 @@ def sync_needed? log_role_changes if roles_changed sync_active_roles if roles_changed set_active_role_flags if roles_changed + stop_apache if roles_changed && !apache_needed? + start_apache if roles_changed && apache_needed? reset_queue_messages if config_changed || roles_changed end