# File lib/daemons/pid.rb, line 8 def Pid.running?(pid) # Check if process is in existence # The simplest way to do this is to send signal '0' # (which is a single system call) that doesn't actually # sending a signal begin Process.kill(0, pid) return true rescue Errno::ESRCH return true rescue Errno::EPERM return false end end