Module: Nanite::DaemonizeHelper

Included in:
Agent, Mapper
Defined in:
lib/nanite/daemonize.rb

Instance Method Summary collapse

Instance Method Details

#daemonizeObject



3
4
5
6
7
8
9
10
# File 'lib/nanite/daemonize.rb', line 3

def daemonize
  exit if fork
  Process.setsid
  exit if fork
  $stdin.reopen("/dev/null")
  $stdout.reopen(log.file, "a")
  $stderr.reopen($stdout)
end