Method: Flydata::Command::Sender#restart

Defined in:
lib/flydata/command/sender.rb

#restart(options = {}) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/flydata/command/sender.rb', line 84

def restart(options = {})
  if process_exist?
    log_info_stdout('Restarting sender process.') unless options[:quiet]
    if Kernel.system("kill -HUP `cat #{pid_file}`")
      log_info_stdout('Done.') unless options[:quiet]
      return true
    else
      raise 'Something has gone wrong..'
    end
  else
    log_info_stdout("Process doesn't exist.") unless options[:quiet]
    start(options)
  end
end