# File lib/daemons/daemonize.rb, line 24
  def simulate(logfile_name = nil, app_name = nil)
    $0 = app_name if app_name

    # Release old working directory
    Dir.chdir '/'

    close_io

    # Free $stdin and point it to somewhere sensible
    begin; $stdin.reopen '/dev/null'; rescue ::Exception; end

    # Split rand streams between spawning and daemonized process
    srand
  end