Class: Servolux::Daemon

Inherits:
Object show all
Defined in:
lib/emissary/servolux.rb

Overview

monkey patches for servolux

Instance Method Summary collapse

Instance Method Details

#alive?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/emissary/servolux.rb', line 22

def alive?
  pid = retrieve_pid
  Process.kill(0, pid)
  true
rescue TypeError # don't fail on nil being passed to kill
  # usually means pid was nil, so return false
  false
rescue Errno::ESRCH, Errno::ENOENT
  false
rescue Errno::EACCES => err
  logger.error "You do not have access to the PID file at " \
               "#{pid_file.inspect}: #{err.message}"
  false
end

#get_pidObject

provide pid to external libraries



21
# File 'lib/emissary/servolux.rb', line 21

def get_pid() retrieve_pid; end