require 'tempfile'require 'daemonize'include Daemonizefork do daemonize log = Tempfile.new('daemon.log') loop do log.puts "I'm a daemon, doin' daemon things." log.flush sleep 5 endendsleep 10