class Unicorn::HttpServer

Public Instance Methods

_original_spawn_missing_workers()
proc_name(tag) click to toggle source

Override the process name for the unicorn processes, both master and worker. This gives all applications a consistent prefix, which can be used to pkill processes by name instead of using pidfiles.

# File lib/unicorn-lockdown.rb, line 41
def proc_name(tag)
  ctx = self.class::START_CTX
  $0 = ["unicorn-#{Unicorn.app_name}-#{tag}"].concat(ctx[:argv]).join(' ')
end
request_filename(pid) click to toggle source

The file name in which to store request information. The /var/www/request-error-data/$app_name folder is accessable only to the user of the application.

# File lib/unicorn-lockdown.rb, line 20
def request_filename(pid)
  "/var/www/request-error-data/#{Unicorn.app_name}/#{pid}.txt"
end
spawn_missing_workers() click to toggle source

This is the master process, set the master pledge before spawning workers, because spawning workers will also need to be done at runtime.

# File lib/unicorn-lockdown.rb, line 29
def spawn_missing_workers
  if pledge = Unicorn.master_pledge
    Unicorn.master_pledge = nil
    Pledge.pledge(pledge, Unicorn.master_execpledge)
  end
  _original_spawn_missing_workers
end