Sha256: 9f14c14fd7beabce5380a8b1a7b47f788ca5455a0cba8a81b24de59561381308

Contents?: true

Size: 1.12 KB

Versions: 23

Compression:

Stored size: 1.12 KB

Contents

# ------------------------------------------------------------------------------
# Sample rails 3 config
# ------------------------------------------------------------------------------

# Set your full path to application.
app_path = "/path/to/app"

# Set unicorn options
worker_processes 1
preload_app true
timeout 180
listen "127.0.0.1:9000"

# Spawn unicorn master worker for user apps (group: apps)
user 'apps', 'apps' 

# Fill path to your app
working_directory app_path

# Should be 'production' by default, otherwise use other env 
rails_env = ENV['RAILS_ENV'] || 'production'

# Log everything to one file
stderr_path "log/unicorn.log"
stdout_path "log/unicorn.log"

# Set master PID location
pid "#{app_path}/tmp/pids/unicorn.pid"

before_fork do |server, worker|
  ActiveRecord::Base.connection.disconnect!

  old_pid = "#{server.config[:pid]}.oldbin"
  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|
  ActiveRecord::Base.establish_connection
end

Version data entries

23 entries across 23 versions & 5 rubygems

Version Path
capistrano-unicorn-sic-0.4.2 examples/rails3.rb
capistrano-unicorn-sic-0.4.1 examples/rails3.rb
capistrano-unicorn-sic-0.4.0 examples/rails3.rb
glebtv-capistrano-unicorn-0.3.1 examples/rails3.rb
sepastian-capistrano3-unicorn-0.5.1 examples/rails3.rb
capistrano-unicorn-sic-0.3.2 examples/rails3.rb
glebtv-capistrano-unicorn-0.3.0 examples/rails3.rb
sepastian-capistrano3-unicorn-0.5.0 examples/rails3.rb
capistrano-unicorn-sic-0.3.1 examples/rails3.rb
sepastian-capistrano3-unicorn-0.4.0 examples/rails3.rb
sepastian-capistrano3-unicorn-0.3.2 examples/rails3.rb
sepastian-capistrano3-unicorn-0.3.0 examples/rails3.rb
capistrano-unicorn-0.2.0 examples/rails3.rb
capistrano-unicorn-0.1.10 examples/rails3.rb
capistrano-unicorn-0.1.9 examples/rails3.rb
capistrano-unicorn-0.1.8 examples/rails3.rb
capistrano-unicorn-0.1.7 examples/rails3.rb
capistrano-unicorn-pleary-0.1.6.1 examples/rails3.rb
capistrano-unicorn-pleary-0.1.7 examples/rails3.rb
capistrano-unicorn-0.1.6 examples/rails3.rb