class Kamisama::ProcessCtrl

Constants

SIGINT
SIGTERM

Public Class Methods

set_parent_death_signal(signal) click to toggle source
# File lib/kamisama/process_ctrl.rb, line 25
def self.set_parent_death_signal(signal)
  case signal
  when :sigint
    LibC.prctl(LibC::PR_SET_PDEATHSIG, SIGINT, 0, 0, 0)
  when :sigterm
    LibC.prctl(LibC::PR_SET_PDEATHSIG, SIGTERM, 0, 0, 0)
  else
    raise "Unrecognized signal '#{signal.inspect}'"
  end
end
set_process_name(process_name) click to toggle source
# File lib/kamisama/process_ctrl.rb, line 17
def self.set_process_name(process_name)
  # The process name is max 16 characters, so get the first 16, and if it is
  # less pad with spaces to avoid formatting wierdness
  process_name = "%-16.16s" % name

  LibC.prctl(LibC::PR_SET_NAME, process_name, 0, 0, 0)
end