Esempio n. 1
0
def run_customer(config, daemon=False):
    if not daemon:
        from toughradius.console import customer_app

        customer_app.run(config, db_engine=get_engine(config))
    else:
        _run_daemon(config, "customer")
Esempio 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')
Esempio 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')
Esempio 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")
Esempio n. 5
0
def run_customer(config):
    from toughradius.console import customer_app
    customer_app.run(config)
Esempio n. 6
0
def run_customer(config, daemon=False):
    if not daemon:
        from toughradius.console import customer_app
        customer_app.run(config, db_engine=get_engine(config))
    else:
        _run_daemon(config, 'customer')