title: Reading and writing data via named pipe with demonization
body: <p>I have two scripts: <br>
  The first one ('Reader') is reading data from named pipe and the second ('Writer') is writing data to named pipe. I am run 'Writer' from daemon (daemon was created with double fork mechanism). If 'Writer' crash I want to print a message about it in 'Reader'. Please see following Python code('Reader'):</p>
  
  <pre><code>pipe = open(pipe_path, 'r')
  while True:
      data = pipe.readline()
      if not data:
          print('Alarm')
          break
  </code></pre>
  
  <p>But when 'Writer' is crashing then 'Reader' is stuck on following line:</p>
  
  <pre><code>data = pipe.readline()
  </code></pre>
  
  <p>But if I run 'Writer' from terminal everything works fine (Alarm message is printing when not data in pipe). And everything works fine if I open pipe with:</p>
  
  <pre><code>os.open(pipe_path, os.O_RDONLY | os.O_NONBLOCK)
  </code></pre>
  
  <p>But this method not suitable for me because I need to wait a time on start when 'Writer' start write data into pipe</p>
  
  <p>In order not to create a zombie I do next in daemon:</p>
  
  <pre><code>def childHandler(signum, frame):
      os.wait3(os.WNOHANG)
  signal.signal(signal.SIGCHLD, zombieKiller)
  </code></pre>
  
  <p>How to prevent the 'Reader' stuck and correctly handle the signal from the child process ?</p>