From 8cd8de4637b5731b4d3ade587307d7241ce99eff Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 14 Apr 2009 13:56:15 -0700 Subject: Explicitly trap SIGINT/SIGTERM again Otherwise we get generally worthless backtraces and we don't want to clobber those for other signals, either. --- lib/unicorn.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/unicorn.rb b/lib/unicorn.rb index bb4054a..17159bf 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -453,6 +453,7 @@ module Unicorn alive = true ready = @listeners client = nil + [:TERM, :INT].each { |sig| trap(sig) { exit(0) } } # instant shutdown trap(:QUIT) do alive = false # graceful shutdown @listeners.each { |sock| sock.close rescue nil } # break IO.select -- cgit v1.2.3-24-ge0c7