Module: SimpleDaemon::PidFile

Defined in:
lib/simple-daemon.rb

Class Method Summary collapse

Class Method Details

.recall(daemon) ⇒ Object



35
36
37
# File 'lib/simple-daemon.rb', line 35

def self.recall(daemon)
  IO.read(daemon.pid_fn).to_i rescue nil
end

.store(daemon, pid) ⇒ Object



31
32
33
# File 'lib/simple-daemon.rb', line 31

def self.store(daemon, pid)
  File.open(daemon.pid_fn, 'w') {|f| f << pid}
end