Ejemplo n.º 1
0
def run_admin(config, daemon=False):
    if not daemon:
        from toughradius.console import admin_app

        admin_app.run(config, db_engine=get_engine(config))
    else:
        _run_daemon(config, "admin")
Ejemplo n.º 2
0
def run_standalone(config,daemon=False):
    from twisted.internet import reactor
    from toughradius.console import admin_app
    from toughradius.console import customer_app
    from toughradius.radiusd import server
    logfile = config.get('radiusd','logfile')
    config.set('DEFAULT','standalone','true')
    config.set('admin','logfile',logfile)
    config.set('customer','logfile',logfile)
    if not daemon:
        db_engine = get_engine(config)
        server.run(config,db_engine,False)
        admin_app.run(config,db_engine,False)
        customer_app.run(config,db_engine,False)
        reactor.run()
    else:
        _run_daemon(config,'standalone')
Ejemplo n.º 3
0
def run_standalone(config, daemon=False):
    from twisted.internet import reactor
    from toughradius.console import admin_app
    from toughradius.console import customer_app
    from toughradius.radiusd import server
    logfile = config.get('radiusd', 'logfile')
    config.set('DEFAULT', 'standalone', 'true')
    config.set('admin', 'logfile', logfile)
    config.set('customer', 'logfile', logfile)
    if not daemon:
        db_engine = get_engine(config)
        server.run(config, db_engine, False)
        admin_app.run(config, db_engine, False)
        customer_app.run(config, db_engine, False)
        reactor.run()
    else:
        _run_daemon(config, 'standalone')
Ejemplo n.º 4
0
def run_standalone(config, daemon=False):
    """
    所有应用在一个进程的运行模式
    """
    from twisted.internet import reactor
    from toughradius.console import admin_app
    from toughradius.console import customer_app
    from toughradius.console import control_app
    from toughradius.radiusd import server

    logfile = config.get("radiusd", "logfile")
    config.set("DEFAULT", "standalone", "true")
    config.set("admin", "logfile", logfile)
    config.set("customer", "logfile", logfile)
    config.set("control", "logfile", logfile)
    if not daemon:
        db_engine = get_engine(config)
        server.run(config, db_engine, False)
        admin_app.run(config, db_engine, False)
        customer_app.run(config, db_engine, False)
        control_app.run(config, False)
        reactor.run()
    else:
        _run_daemon(config, "standalone")
Ejemplo n.º 5
0
def run_admin(config):
    from toughradius.console import admin_app
    admin_app.run(config)
Ejemplo n.º 6
0
def run_admin(config, daemon=False):
    if not daemon:
        from toughradius.console import admin_app
        admin_app.run(config, db_engine=get_engine(config))
    else:
        _run_daemon(config, 'admin')