Files
forum/unicorn.ru

20 lines
598 B
Ruby
Executable File

working_directory "/opt/horse_forum/forum/"
pid "/tmp/horse_forum.pid"
preload_app true
timeout 60
worker_processes 4
listen "/tmp/horseforum.sock"
stderr_path('/opt/horse_forum/unicorn.log')
GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true
after_fork do |server, worker|
#start the worker on port 4000, 4001, 4002 etc...
addr = "0.0.0.0:#{3000 + worker.nr}"
# infinite tries to start the worker
server.listen(addr, :tries => -1, :delay => -1, :backlog => 128)
#Drop privileges if running as root
worker.user('nobody', 'nobody') if Process.euid == 0
end