Skip to content

Commit

Permalink
Call ResetFailedUnit when cleaning up failed services
Browse files Browse the repository at this point in the history
If a systemd service has failed it stays around until you call
`systemd reset-failed unit-name`
  • Loading branch information
agrare committed Nov 12, 2020
1 parent ace7b47 commit 97f0f8b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/miq_server/worker_management/monitor/systemd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 97f0f8b

Please sign in to comment.