Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle TERM signal

  • Loading branch information...
commit 28d337f4302a90fc4cf7ebe0a10d25d299e3d7f4 1 parent 2feb141
@lmarburger lmarburger authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 config/unicorn.rb
View
7 config/unicorn.rb
@@ -3,7 +3,14 @@
preload_app false
before_fork do |server, worker|
+ Signal.trap 'TERM' do
+ puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
+ Process.kill 'QUIT', Process.pid
+ end
end
after_fork do |server, worker|
+ Signal.trap 'TERM' do
+ puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to sent QUIT'
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.