Class: Ap4r::Mongrel::Restart

Inherits:
Object
  • Object
show all
Includes:
Command::Base
Defined in:
lib/ap4r/mongrel_ap4r.rb

Instance Method Summary collapse

Methods included from Command::Base

included, #send_signal

Instance Method Details

#configureObject



197
198
199
200
201
202
# File 'lib/ap4r/mongrel_ap4r.rb', line 197

def configure
  options [
    ['-c', '--chdir PATH', "Change to dir", :@cwd, Dir.pwd],
    ['-P', '--pid FILE', "PID file", :@pid_file, "log/mongrel_ap4r.pid"],
  ]
end

#runObject



214
215
216
# File 'lib/ap4r/mongrel_ap4r.rb', line 214

def run
  send_signal("USR2", @pid_file)
end

#validateObject



204
205
206
207
208
209
210
211
212
# File 'lib/ap4r/mongrel_ap4r.rb', line 204

def validate
  @cwd = File.expand_path(@cwd)
  valid_dir? @cwd, "Path of chdir not valid: #@cwd "
  Dir.chdir(@cwd)

  valid_dir? File.dirname(@pid_file), "Path to pid file not valid: #@pid_file"

  return @valid
end