From 97f0f8b958a82707b88723d9867a44dab3280a89 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Thu, 12 Nov 2020 12:55:38 -0500 Subject: [PATCH] Call ResetFailedUnit when cleaning up failed services If a systemd service has failed it stays around until you call `systemd reset-failed unit-name` --- app/models/miq_server/worker_management/monitor/systemd.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/miq_server/worker_management/monitor/systemd.rb b/app/models/miq_server/worker_management/monitor/systemd.rb index 02db4e39e9e4..2a0c40acc48c 100644 --- a/app/models/miq_server/worker_management/monitor/systemd.rb +++ b/app/models/miq_server/worker_management/monitor/systemd.rb @@ -29,6 +29,7 @@ def systemd_manager def systemd_stop_services(service_names) service_names.each do |service_name| systemd_manager.StopUnit(service_name, "replace") + systemd_manager.ResetFailedUnit(service_name) service_settings_dir = systemd_unit_dir.join("#{service_name}.d") FileUtils.rm_r(service_settings_dir) if service_settings_dir.exist?