From: Han Holl Date: 2007-10-04T18:47:25+09:00 Subject: Signal handling strangeness (Linux) Hi, The following program: #!/usr/bin/ruby -w IO.popen("tail -F --lines=0 --pid=#{Process.pid} /var/log/messages") do |h| while line = h.gets puts line end end # end-of-program can be terminated with 'kill -TERM pid'. This one: #!/usr/bin/ruby -w trap('TERM') do exit end IO.popen("tail -F --lines=0 --pid=#{Process.pid} /var/log/messages") do |h| while line = h.gets puts line end end # end-of-program cannot. It hangs on a waitpid (or wait4) for the tail process. Why is this ? And is it reasonable ? Han Holl PS Forgot to say: this is Linux.