Maintenance of Ruby 2.0.0 ended on February 24, 2016. Read more

In Files

  • webrick/server.rb

Parent

Methods

WEBrick::Daemon

A generic module for daemonizing a process

Public Class Methods

start() click to toggle source

Performs the standard operations for daemonizing a process. Runs a block, if given.

 
               # File webrick/server.rb, line 45
def Daemon.start
  exit!(0) if fork
  Process::setsid
  exit!(0) if fork
  Dir::chdir("/")
  File::umask(0)
  STDIN.reopen("/dev/null")
  STDOUT.reopen("/dev/null", "w")
  STDERR.reopen("/dev/null", "w")
  yield if block_given?
end