diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-02-13 21:02:10 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-02-13 21:02:10 -0800 |
commit | 225a108c5326fdc1a00531908a2278c06ac782f6 (patch) | |
tree | 2c68e3430ab8e2daa99dbc6598096b806a57254b /lib | |
parent | ca4236a71760b8b4dbadac936fa348b18128a56f (diff) | |
download | unicorn-225a108c5326fdc1a00531908a2278c06ac782f6.tar.gz |
And avoid repeatedly sending kill -0 to each worker, that nugget of stupid probably slipped in while I was testing something...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicorn.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 63d7f5c..df94a96 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -159,14 +159,13 @@ module Unicorn @rd_sig, @wr_sig = IO.pipe unless (@rd_sig && @wr_sig) @rd_sig.nonblock = @wr_sig.nonblock = true - %w(QUIT INT TERM USR1 USR2 HUP).each { |sig| trap_deferred(sig) } + %w(CHLD QUIT INT TERM USR1 USR2 HUP).each { |sig| trap_deferred(sig) } $0 = "unicorn master" begin loop do reap_all_workers case @mode when :idle - kill_each_worker(0) # ensure they're running murder_lazy_workers spawn_missing_workers when 'QUIT' # graceful shutdown @@ -376,6 +375,7 @@ module Unicorn # by the user. def init_worker_process(worker) %w(TERM INT QUIT USR1 USR2 HUP).each { |sig| trap(sig, 'IGNORE') } + trap('CHLD', 'DEFAULT') $0 = "unicorn worker[#{worker.nr}]" @rd_sig.close if @rd_sig @wr_sig.close if @wr_sig |