flashpolicyd.rb
# Goes into the background, chdir's to /tmp, and redirect all input/output to null
# Beginning Ruby p. 489-490
Goes into the background, chdir's to /tmp, and redirect all input/output to null
Beginning Ruby p.
Goes into the background chdir ' s to / tmp and redirect all input / output to null Beginning Ruby p .
def run_server
  if @daemonize
    fork do
      Process.setsid
      exit if fork
      Dir.chdir('/tmp')
      STDIN.reopen('/dev/null')
      STDOUT.reopen('/dev/null', 'a')
      STDERR.reopen('/dev/null', 'a')
      trap("TERM") {
        @logger.debug("Caught TERM signal")
        exit
      }
      yield
    end
  else
    yield
  end
end
def run_server if @daemonize fork do Process . setsid exit if fork Dir . chdir ( '/tmp' ) STDIN . reopen ( '/dev/null' ) STDOUT . reopen ( '/dev/null' , 'a' ) STDERR . reopen ( '/dev/null' , 'a' ) trap ( "TERM" ) { @logger . debug ( "Caught TERM signal" ) exit } yield end else yield end end
Goes into the background, chdir's to /tmp, and redirect all input/output to null
Beginning Ruby p. 489-490
Goes into the background chdir ' s to / tmp and redirect all input / output to null Beginning Ruby p . 489 - 490