Module: Daemon::PidFile
- Defined in:
- lib/inari/daemon.rb
Class Method Summary collapse
Class Method Details
.recall(daemon) ⇒ Object
26 27 28 |
# File 'lib/inari/daemon.rb', line 26 def self.recall(daemon) IO.read(daemon.pid_file_name).split("\n").collect {|pid| pid.to_i } rescue nil end |
.store(daemon, pid) ⇒ Object
22 23 24 |
# File 'lib/inari/daemon.rb', line 22 def self.store(daemon, pid) File.open(daemon.pid_file_name, 'a+') {|f| f << pid.to_s + "\n"} end |