daemon spawn : Daemon « Threads « Ruby






daemon spawn


require 'tempfile'
require 'daemonize'
include Daemonize

fork do
  daemonize
  log = Tempfile.new('daemon.log')
  loop do
    log.puts "I'm a daemon, doin' daemon things."
    log.flush
    sleep 5
  end
end

sleep 10

 








Related examples in the same category

1.Forking a Daemon Process on Unix.rb
2.webrick daemon