Sha256: 356d7ed41bfab5299adc9d0e225da9d491d9203f886279e2e4d8ac1de1428801

Contents?: true

Size: 1.08 KB

Versions: 12

Compression:

Stored size: 1.08 KB

Contents

deploy_to   = "/home/<%= application_name %>/htdocs"
rails_root  = "#{deploy_to}/current"
pid_file    = "#{deploy_to}/shared/pids/unicorn.pid"
socket_file = "#{deploy_to}/shared/sockets/unicorn.sock"
log_file    = "#{rails_root}/log/unicorn.log"
err_log     = "#{rails_root}/log/unicorn_error.log"
old_pid     = pid_file + '.oldbin'

timeout          30
worker_processes 2
listen           socket_file, :backlog => 1024
pid              pid_file
stderr_path      err_log
stdout_path      log_file
preload_app      true

GC.copy_on_write_friendly = true if GC.respond_to?(:copy_on_write_friendly=)

before_exec do |server|
  ENV["BUNDLE_GEMFILE"] = "#{rails_root}/Gemfile"
end

before_fork do |server, worker|
  defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect!

  if File.exists?(old_pid) && server.pid != old_pid
    begin
      Process.kill("QUIT", File.read(old_pid).to_i)
    rescue Errno::ENOENT, Errno::ESRCH
      # someone else did our job for us
    end
  end
end

after_fork do |server, worker|
  defined?(ActiveRecord::Base) and
  ActiveRecord::Base.establish_connection
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
playmo-0.1.10 recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.1.9 recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.1.8 recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.1.7 recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.1.6 recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.1.5 recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.1.4 recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.1.3 recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.1.2 recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.1.1 lib/playmo/recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.1.0 lib/playmo/recipes/templates/unicorn_recipe/unicorn.rb
playmo-0.0.18 lib/playmo/recipes/templates/unicorn_recipe/unicorn.rb