Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Handle TERM signal

  • Loading branch information...
commit 28d337f4302a90fc4cf7ebe0a10d25d299e3d7f4 1 parent 2feb141
Larry Marburger authored February 27, 2013

Showing 1 changed file with 7 additions and 0 deletions. Show diff stats Hide diff stats

  1. 7  config/unicorn.rb
7  config/unicorn.rb
@@ -3,7 +3,14 @@
3 3
 preload_app false
4 4
 
5 5
 before_fork do |server, worker|
  6
+  Signal.trap 'TERM' do
  7
+    puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
  8
+    Process.kill 'QUIT', Process.pid
  9
+  end
6 10
 end
7 11
 
8 12
 after_fork do |server, worker|
  13
+  Signal.trap 'TERM' do
  14
+    puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to sent QUIT'
  15
+  end
9 16
 end

0 notes on commit 28d337f

Please sign in to comment.
Something went wrong with that request. Please try again.