Class: ProconBypassMan::ProcessChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/support/proccess_cheacker.rb

Class Method Summary collapse

Class Method Details

.running?(pid) ⇒ Boolean

Parameters:

  • pid (integer)

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
13
# File 'lib/procon_bypass_man/support/proccess_cheacker.rb', line 4

def self.running?(pid)
  begin
    Process.kill(0, pid)
    true
  rescue Errno::ESRCH
    false
  rescue Errno::EPERM
    true
  end
end