From 5a0506c2affd2f5abe6e7315121e67aa3e32b253 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 16 Jul 2010 08:25:32 +0000 Subject: SIGTTIN works after SIGWINCH In addition to SIGHUP, it should be possible to gradually bring workers back up (to avoid overloading the machine) when rolling back upgrades after SIGWINCH. Noticed-by: Lawrence Pit ref: http://mid.gmane.org/4C3F8C9F.2090903@gmail.com (cherry picked from commit e75ee7615f9875db314a6403964e7b69a68b0521) --- lib/unicorn.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/unicorn.rb') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index cbb5520..e2d1ac1 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -422,10 +422,12 @@ module Unicorn respawn = false logger.info "gracefully stopping all workers" kill_each_worker(:QUIT) + self.worker_processes = 0 else logger.info "SIGWINCH ignored because we're not daemonized" end when :TTIN + respawn = true self.worker_processes += 1 when :TTOU self.worker_processes -= 1 if self.worker_processes > 0 -- cgit v1.2.3-24-ge0c7