I'm writing a daemon in Ruby 1.8.7 (i.e., no Process.daemon) using a double-fork + setsid:
exit if fork
Process.setsid
exit if fork
After all of this, I still, for some reason, seem to be able to print out to stdout. From everything I've read, the daemon process should not have a controlling terminal, and writes to stdout should not do anything. However, if I follow up the above with a:
puts "Hello world"
"Hello world" is printed to the screen. Is this expected behavior?