def become_daemon(our_home_dir='.', out_log=None, err_log=None, umask=0o022):
        os.chdir(our_home_dir)
        os.umask(umask)
        sys.stdin.close()
        sys.stdout.close()
        sys.stderr.close()
        if err_log:
            sys.stderr = open(err_log, 'a', 0)
        else:
            sys.stderr = NullDevice()
        if out_log:
            sys.stdout = open(out_log, 'a', 0)
        else:
            sys.stdout = NullDevice()
If we're not running under a POSIX system, just simulate the daemon
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/utils/daemonize.py/become_daemon