Module Daemon::PidFile
In: lib/serverside/daemon.rb

Stores and recalls the daemon pid.

Methods

recall   remove   store  

Public Class methods

Recalls the daemon pid. If the pid can not be recalled, an error is raised.

[Source]

    # File lib/serverside/daemon.rb, line 22
22:     def self.recall(daemon)
23:       IO.read(daemon.pid_fn).to_i
24:     rescue
25:       raise 'Pid not found. Is the daemon started?'
26:     end

[Source]

    # File lib/serverside/daemon.rb, line 28
28:     def self.remove(daemon)
29:       FileUtils.rm(daemon.pid_fn) if File.file?(daemon.pid_fn)
30:     end

Stores the daemon pid.

[Source]

    # File lib/serverside/daemon.rb, line 16
16:     def self.store(daemon, pid)
17:       File.open(daemon.pid_fn, 'w') {|f| f << pid}
18:     end

[Validate]