about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/yahns/daemon.rb6
-rw-r--r--lib/yahns/server.rb2
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/yahns/daemon.rb b/lib/yahns/daemon.rb
index f6cdf47..fd93fd7 100644
--- a/lib/yahns/daemon.rb
+++ b/lib/yahns/daemon.rb
@@ -19,7 +19,11 @@ module Yahns::Daemon # :nodoc:
 
     # We only start a new process group if we're not being reexecuted
     # and inheriting file descriptors from our parent
-    unless ENV['YAHNS_FD']
+    if ENV['YAHNS_FD']
+      # if we're inheriting, need to ensure this remains true so
+      # SIGWINCH works when worker processes are in play
+      yahns_server.daemon_pipe = true
+    else
       # grandparent - reads pipe, exits when master is ready
       #  \_ parent  - exits immediately ASAP
       #      \_ yahns master - writes to pipe when ready
diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb
index 3c0c330..9790783 100644
--- a/lib/yahns/server.rb
+++ b/lib/yahns/server.rb
@@ -201,7 +201,7 @@ class Yahns::Server # :nodoc:
   end
 
   def daemon_ready
-    @daemon_pipe or return
+    @daemon_pipe.respond_to?(:syswrite) or return
     @daemon_pipe.syswrite("#$$")
     @daemon_pipe.close
     @daemon_pipe = true # for SIGWINCH