Method: Flydata::Command::Sender#stop

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

#stop(options = {}) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/flydata/command/sender.rb', line 52

def stop(options = {})
  unless process_exist?
    log_info_stdout("Process doesn't exist.") unless options[:quiet]
    return true
  end

  log_info_stdout('Stopping sender process.') unless options[:quiet]
  if Kernel.system("kill `cat #{pid_file}`") and wait_until_client_stop(options)
    log_info_stdout('Done.') unless options[:quiet]
    return true
  end
  raise 'Something has gone wrong..'
end