Method: Daemon::Controller.stop

Defined in:
lib/chocolate_rain/daemon.rb

.stop(daemon) ⇒ Object



57
58
59
60
61
62
63
64
65
# File 'lib/chocolate_rain/daemon.rb', line 57

def self.stop(daemon)
  if !File.file?(daemon.pid_fn)
    puts "Pid file not found. Is the daemon started?"
    exit
  end
  pid = PidFile.recall(daemon)
  FileUtils.rm(daemon.pid_fn)
  pid && Process.kill("TERM", pid)
end