def flup_fastcgi(wsgi_app, bind, cwd=None, pidfile=None, logfile=None,
                 daemonize=False, umask=None, **params):
    if params.pop('preforked', False):
        from flup.server import fcgi_fork as fcgi
    else:
        from flup.server import fcgi
    if daemonize:
        if os.path.isfile(pidfile):
            with open(pidfile, 'r') as f:
                try:
                    pid = int(f.read())
                except __HOLE__:
                    pid = None

            if pid is not None and  is_running(pid):
                sys.exit('Already running (PID: {})'.format(pid))
            elif pid is not None:
                logger.info('PID file was pointing to nonexistent process %r',
                            pid)
            else:
                logger.info('PID file should contain a number')
        doublefork(pidfile, logfile, cwd, umask)
    logger.info('Starting FastCGI server (flup), current working dir %r', cwd)
    fcgi.WSGIServer(wsgi_app, bindAddress=bind, umask=umask,
                    debug=False, **params).run()
dataset/ETHPy150Open SmartTeleMax/iktomi/iktomi/cli/fcgi.py/flup_fastcgi