Class: Unicorn::HttpServer

Inherits:
Object
  • Object
show all
Defined in:
lib/unicorn-lockdown.rb

Instance Method Summary collapse

Instance Method Details

#proc_name(tag) ⇒ Object

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.



28
29
30
31
# File 'lib/unicorn-lockdown.rb', line 28

def proc_name(tag)
  ctx = self.class::START_CTX
  $0 = ["unicorn-#{Unicorn.app_name}-#{tag}"].concat(ctx[:argv]).join(' ')
end

#request_filename(pid) ⇒ Object

The file name in which to store request information. The /var/www/requests folder is currently accessable only to root.



21
22
23
# File 'lib/unicorn-lockdown.rb', line 21

def request_filename(pid)
  "/var/www/requests/#{Unicorn.app_name}.#{pid}.txt"
end