Report abuse

def self.pid_active?(pid)
  begin
    Process.getpgid(pid.to_i)
    true
  rescue NotImplementedError
    true
  rescue Exception
    false
  end
end