From b48c6659b294b37f2c6ff3e75c1c9245522d48d1 Mon Sep 17 00:00:00 2001 From: Brian P O'Rourke Date: Wed, 14 Sep 2011 18:50:29 +0800 Subject: Detect daemonization via configuration. This prevents the stopping of all workers by SIGWINCH if you're using a windowing system that will 'exec' unicorn from a process that's already in a process group. Acked-by: Eric Wong --- lib/unicorn/http_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index ae0e175..65880d4 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -282,7 +282,7 @@ class Unicorn::HttpServer when :USR2 # exec binary, stay alive in case something went wrong reexec when :WINCH - if Process.ppid == 1 || Process.getpgrp != $$ + if Unicorn::Configurator::RACKUP[:daemonized] respawn = false logger.info "gracefully stopping all workers" kill_each_worker(:QUIT) -- cgit v1.2.3-24-ge0c7