Skip to content

Commit

Permalink
We write service and target files, just call them units
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Nov 19, 2020
1 parent f7d11bb commit d215045
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/models/miq_server/at_startup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,14 +18,18 @@ 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?
rescue => err
_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
Expand Down

0 comments on commit d215045

Please sign in to comment.