Method: Fallen#start!
- Defined in:
- lib/fallen.rb
#start! ⇒ Object
Brings the fallen angel to life
If a PID file was provided it will try to store the current
PID. If this files exists it will try to check if the stored PID
is already running, in which case Fallen
will exit with an error
code.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/fallen.rb', line 70 def start! if @pid_file && File.exists?(@pid_file) pid = File.read(@pid_file).strip begin Process.kill 0, pid.to_i STDERR.puts "Daemon is already running with PID #{pid}" exit 2 rescue Errno::ESRCH run! end else run! end end |