Class: Blazing::Recipe::RestartProcesses

Inherits:
Blazing::Recipe
  • Object
show all
Defined in:
lib/blazing-foreman/recipes/restart_processes.rb

Instance Method Summary collapse

Instance Method Details

#run(target_options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/blazing-foreman/recipes/restart_processes.rb', line 6

def run(target_options = {})
  super target_options

  info "restarting processes"
  if complex_restart?
    processes.each do |process|
      restart = restart_command process
      system "#{sudo} initctl start #{application}-#{process} || #{sudo} initctl #{restart} #{application}-#{process}"
    end
  else
    system "#{sudo} initctl start #{application} || #{sudo} initctl restart #{application}"
  end
end