OpenVPN status daemon

def main(conf):
    """ OpenVPN status daemon 
    """
    config = init_config(conf)
    nas_addr = config.get('DEFAULT', 'nas_addr')
    status_file = config.get('DEFAULT', 'statusfile')
    status_dbfile = config.get('DEFAULT', 'statusdb')
    nas_coa_port = config.get('DEFAULT', 'nas_coa_port')

    def do_update_status_task(): 
        d = deferToThread(update_status, status_dbfile, status_file, nas_addr)
        d.addCallback(log.msg,'do_update_status_task done!')
        d.addErrback(log.err)
        reactor.callLater(60.0,do_update_status_task)

    def do_accounting_task(): 
        d = deferToThread(accounting, status_dbfile, config)
        d.addCallback(log.msg,'do_accounting_task done!')
        d.addErrback(log.err)
        reactor.callLater(60.0,do_accounting_task)

    do_update_status_task()
    do_accounting_task()

    coa_protocol = Authorized(config)
    reactor.listenUDP(int(nas_coa_port), coa_protocol, interface='0.0.0.0')
    reactor.run()