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



194
195
196
197
198
199
# File 'lib/ap4r/mongrel_ap4r.rb', line 194

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



211
212
213
# File 'lib/ap4r/mongrel_ap4r.rb', line 211

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

#validateObject



201
202
203
204
205
206
207
208
209
# File 'lib/ap4r/mongrel_ap4r.rb', line 201

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