Class: Blazing::Recipe::UpstartRestart

Inherits:
Blazing::Recipe
  • Object
show all
Defined in:
lib/appboost/blazing/upstart_restart.rb

Instance Method Summary collapse

Instance Method Details

#run(target_options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/appboost/blazing/upstart_restart.rb', line 5

def run(target_options = {})
  super target_options

  if options[:processes].nil? || options[:processes].empty?
    info "restarting appl"
    system "#{sudo} start #{application} || #{sudo} restart #{application}"
  else
    info "restarting app processes - [#{options[:processes]}"
    options[:processes].each do |p|
      system "#{sudo} start #{application}-#{p} || #{sudo} restart #{application}-#{p}"
    end
  end
end