From d21504590d28e96f1ae3c6485cafff897d0a0823 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Wed, 18 Nov 2020 12:43:55 -0500 Subject: [PATCH] We write service and target files, just call them units --- app/models/miq_server/at_startup.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/miq_server/at_startup.rb b/app/models/miq_server/at_startup.rb index 6761e063060..98fd8351498 100644 --- a/app/models/miq_server/at_startup.rb +++ b/app/models/miq_server/at_startup.rb @@ -5,7 +5,7 @@ module MiqServer::AtStartup module ClassMethods def startup! log_managed_entities - write_systemd_service_files if MiqEnvironment::Command.supports_systemd? + write_systemd_unit_files clean_all_workers clean_dequeued_messages purge_report_results @@ -18,7 +18,10 @@ def log_managed_entities log_not_under_management(prefix) end - def write_systemd_service_files + def write_systemd_unit_files + return unless MiqEnvironment::Command.supports_systemd? + + _log.info("Writing Systemd unit files...") MiqWorkerType.worker_class_names.each do |class_name| worker_klass = class_name.safe_constantize worker_klass.ensure_systemd_files if worker_klass&.systemd_worker? @@ -26,6 +29,7 @@ def write_systemd_service_files _log.warn("Failed to write systemd service files: #{err}") _log.log_backtrace(err) end + _log.info("Writing Systemd unit files...Complete") end # Delete and Kill all workers that were running previously