Project

General

Profile

Bug #8348 » test_ruby_daemonized_process_hang_kfreebsd.rb

Test file revealing hangs in ruby scripts using Process.daemon on Debian GNU/kFreeBSD. - JoeKun (Joel Lopes Da Silva), 04/30/2013 04:06 PM

 
#! /usr/bin/env ruby

def debuglog(s)
File.open("/tmp/debug.log", "a+") do |f|
f.write "#{s}\n"
end
end

ENV.each do |k, v|
debuglog "before daemon: #{k} -> #{v}"
end
debuglog "right before daemon"
Process.daemon(true, false)
debuglog "right after daemon"
ENV.each do |k, v|
debuglog "after daemon: #{k} -> #{v}"
end

debuglog "done."

(1-1/2)