Module: Nanite::DaemonizeHelper
Instance Method Summary collapse
Instance Method Details
#daemonize(identity, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/nanite/daemonize.rb', line 3 def daemonize(identity, = {}) exit if fork Process.setsid exit if fork STDIN.reopen "/dev/null" STDOUT.reopen "#{[:log_path]}/nanite.#{identity}.out", "a" STDERR.reopen "#{[:log_path]}/nanite.#{identity}.err", "a" File.umask 0000 end |