Module: Ap4r::Mongrel::Command::Base

Included in:
Help, Restart, Start, Stop, Version
Defined in:
lib/ap4r/mongrel_ap4r.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/ap4r/mongrel_ap4r.rb', line 17

def self.included(klass)
  return unless klass.kind_of?(Class)
  klass.class_eval do |k|
    include(::Mongrel::Command::Base)
  end


  # TODO: Can subclass the return of RubyGems::GemPlugin ? 2007/04/16 by shino
end

Instance Method Details

#send_signal(signal, pid_file) ⇒ Object

send a signal to the process specified by pid_file.



28
29
30
31
32
33
34
35
36
37
# File 'lib/ap4r/mongrel_ap4r.rb', line 28

def send_signal(signal, pid_file)
  pid = open(pid_file).read.to_i
  print "Send signal #{signal} to AP4R at PID #{pid} ..."
  begin
    Process.kill(signal, pid)
  rescue Errno::ESRCH
    puts "Process not found."
  end
  puts "Done."
end