Class: Rails::MongrelServer::Restart

Inherits:
Object
  • Object
show all
Includes:
Mongrel::Command::Base
Defined in:
lib/rails/mongrel_server/commands.rb

Instance Method Summary collapse

Instance Method Details

#configureObject



320
321
322
323
324
325
# File 'lib/rails/mongrel_server/commands.rb', line 320

def configure
  options [
    ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, '.'],
    ['-P', '--pid FILE', "Where the PID file is located", :@pid_file, "log/mongrel.pid"]
  ]
end

#runObject



337
338
339
# File 'lib/rails/mongrel_server/commands.rb', line 337

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

#validateObject



327
328
329
330
331
332
333
334
335
# File 'lib/rails/mongrel_server/commands.rb', line 327

def validate
  @cwd = File.expand_path(@cwd)
  valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd"

  Dir.chdir @cwd

  valid_exists? @pid_file, "PID file #@pid_file does not exist.  Not running?"
  return @valid
end