3 # Daemonize the current process
9 STDIN.reopen('/dev/null')
10 STDOUT.reopen('/dev/null', 'a')
11 STDERR.reopen('/dev/null', 'a')
17 def self.daemonize_runner(pid=nil)
18 raise "The Unix Daemonizer can not be used on the Windows Platform" if Util.windows?
20 UnixDaemon.daemonize do
23 File.open(pid, 'w') {|f| f.write(Process.pid) }
29 runner = Runner.new(nil)
32 File.unlink(pid) if pid && File.exist?(pid)