Permalink
Browse files

Git ignore config/unicorn.rb

  • Loading branch information...
reyesyang committed Dec 26, 2013
1 parent 663aef8 commit 13bd0f337492bd99a12628f44eba20682e71dcb9
Showing with 22 additions and 20 deletions.
  1. +2 −0 .gitignore
  2. +1 −1 config/deploy.example.rb
  3. +5 −5 config/deploy/production.example.rb
  4. +14 −14 config/{unicorn.rb → unicorn.example.rb}
View
@@ -6,8 +6,10 @@ tmp/
vendor/cache
vendor/bundle
package/
+
config/database.yml
config/app_config.yml
config/deploy.rb
config/deploy/production.rb
config/nginx.conf
+config/unicorn.rb
View
@@ -11,7 +11,7 @@
# set :log_level, :debug
# set :pty, true
-set :linked_files, %w{config/database.yml config/app_config.yml config/nginx.conf}
+set :linked_files, %w{config/database.yml config/app_config.yml config/unicorn.rb config/nginx.conf}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
@@ -5,24 +5,24 @@
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
-#role :app, %w{deploy@example.com}
-#role :web, %w{deploy@example.com}
-#role :db, %w{deploy@example.com}
-role :all, %w{deploy@example.com}
+role :app, %w{deploy@example.com}
+role :web, %w{deploy@example.com}
+role :db, %w{deploy@example.com}
# Extended Server Syntax
# ======================
# This can be used to drop a more detailed server
# definition into the server list. The second argument
# something that quacks like a hash can be used to set
# extended properties on the server.
-server 'deploy@example.com', user: 'deployer'
+# server 'example.com', roles: %w{web app}, my_property: :my_value
# you can set custom ssh options
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start)
# set it globally
set :ssh_options, {
+ user: fetch(:user),
# port: 22, # overrides if your change ssh service port
forward_agent: true
}
@@ -27,7 +27,7 @@
# listen on both a Unix domain socket and a TCP port,
# we use a shorter backlog for quicker failover when busy
-listen "/tmp/unicorn.reyesyang-info.sock", :backlog => 64
+listen "/tmp/unicorn.your-app.sock", :backlog => 64
listen 8080, :tcp_nopush => true
# nuke workers after 30 seconds instead of 60 seconds (the default)
@@ -72,19 +72,19 @@
# installations. It is not needed if your system can house
# twice as many worker_processes as you have configured.
#
- # # This allows a new master process to incrementally
- # # phase out the old master process with SIGTTOU to avoid a
- # # thundering herd (especially in the "preload_app false" case)
- # # when doing a transparent upgrade. The last worker spawned
- # # will then kill off the old master process with a SIGQUIT.
- # old_pid = "#{server.config[:pid]}.oldbin"
- # if old_pid != server.pid
- # begin
- # sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
- # Process.kill(sig, File.read(old_pid).to_i)
- # rescue Errno::ENOENT, Errno::ESRCH
- # end
- # end
+ # This allows a new master process to incrementally
+ # phase out the old master process with SIGTTOU to avoid a
+ # thundering herd (especially in the "preload_app false" case)
+ # when doing a transparent upgrade. The last worker spawned
+ # will then kill off the old master process with a SIGQUIT.
+ old_pid = "#{server.config[:pid]}.oldbin"
+ if File.exists?(old_pid) && old_pid != server.pid
+ begin
+ sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
+ Process.kill(sig, File.read(old_pid).to_i)
+ rescue Errno::ENOENT, Errno::ESRCH
+ end
+ end
#
# Throttle the master from forking too quickly by sleeping. Due
# to the implementation of standard Unix signal handlers, this

0 comments on commit 13bd0f3

Please sign in to comment.