Class: Blazing::Recipe::RestartProcesses

Inherits:
Blazing::Recipe
  • Object
show all
Defined in:
lib/blazing-upstart/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
# File 'lib/blazing-upstart/recipes/restart_processes.rb', line 6

def run(target_options = {})
  super target_options

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