Class: Flydata::Helper::Action::CheckAbnormalShutdown

Inherits:
BaseAction
  • Object
show all
Defined in:
lib/flydata/helper/action/check_abnormal_shutdown.rb

Instance Attribute Summary

Attributes inherited from BaseAction

#config

Instance Method Summary collapse

Methods inherited from BaseAction

#initialize

Constructor Details

This class inherits a constructor from Flydata::Helper::BaseAction

Instance Method Details

#execute(opts = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/flydata/helper/action/check_abnormal_shutdown.rb', line 9

def execute(opts = {})
  if abnormal_shutdown_occurred?
    if Command::Base.command_process_exist?
      log_info "Abnormal shutdown occurred but another command is stil running.  Skip agent restart."
    else
      log_info "Abnormal shutdown occurred.  Restart the agent."
      yield :restart_agent, nil
    end
  end
end