From: usa@... Date: 2014-01-30T11:46:52+00:00 Subject: [ruby-core:60340] [ruby-trunk - Bug #8616] Process.daemon messes up threads Issue #8616 has been updated by Usaku NAKAMURA. Backport changed from 1.9.3: UNKNOWN, 2.0.0: DONE to 1.9.3: DONE, 2.0.0: DONE backported into ruby_1_9_3 at r44766. ---------------------------------------- Bug #8616: Process.daemon messes up threads https://bugs.ruby-lang.org/issues/8616#change-44829 * Author: Aaron Patterson * Status: Closed * Priority: Normal * Assignee: * Category: * Target version: * ruby -v: ruby 2.1.0dev (2013-07-10 trunk 41870) [x86_64-darwin12.4.0] * Backport: 1.9.3: DONE, 2.0.0: DONE ---------------------------------------- =begin Hi, When I daemonize a process, it somehow messes up threads from the parent process. Here is a script to reproduce the problem: r1, w1 = IO.pipe r2, w2 = IO.pipe t = Thread.new { puts "start" w1.write "x" IO.select([r2]) puts "alive" } IO.select([r1]) Process.daemon true, true # comment this line out and everything works puts Process.pid w2.write "x" t.join puts "done" If you run this program, there will be a ruby process in the background that never dies. If you comment out the "Process.daemon" line, the script finishes. =end -- http://bugs.ruby-lang.org/