A generic module for daemonizing a process
      Class Methods
    
  
          
            2.3
          
          
            View on GitHub
            
          
        
        
          
            # File tmp/rubies/ruby-2.3.8/lib/webrick/server.rb, line 46
def Daemon.start
  exit!(0) if fork
  Process::setsid
  exit!(0) if fork
  Dir::chdir("/")
  File::umask(0)
  STDIN.reopen(IO::NULL)
  STDOUT.reopen(IO::NULL, "w")
  STDERR.reopen(IO::NULL, "w")
  yield if block_given?
end
          
        
      Performs the standard operations for daemonizing a process. Runs a block, if given.