Hi all,

        I'm trying to use 2 different MySQL databases so that in the case of
the primary failing there's a secondary database in order to do the
authentication.
        This setup is working if i don't use rlm_sqlcounter to check if the
users already used their time.
        I tried doing the same thing (group) for rlm_sqlcounter, but it seems
rlm_sqlcounter succeeds when it doesn't manage to connect to the
database. It seems to me that it considers the sql error as if it
returned that the user hasn't still used any time.
        Wonder if any1 managed to get a similar setup to work or as any ideas,
bellow i send the radiusd.conf part and partial log.

Thanks in advance,
Manuel Sousa

>From : http://www.frontios.com/freeradius.html
  group {
    sql2 {
      fail  = 1
      notfound = return
      noop  = 2
      ok  = return
      updated = 3
      reject = return
      userlock = 4
      invalid = 5
      handled = 6
    }
    sql {
      fail  = 1
      notfound = return
      noop  = 2
      ok  = return
      updated = 3
      reject = return
      userlock = 4
      invalid = 5
      handled = 6
    }
  }

Part of the Log:

rlm_sqlcounter: Entering module authorize code
sqlcounter_expand:  'SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='%{User-Name}''
radius_xlat:  'SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='z000057''
sqlcounter_expand:  '%{sql2:SELECT SUM(AcctSessionTime) FROM radacct
WHERE UserName='z000057'}'
radius_xlat: Running registered xlat function of module sql2 for string
'SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='z000057''
rlm_sql (sql2): - sql_xlat
radius_xlat:  'SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='z000057''
rlm_sql (sql2): Ignoring unconnected handle
rlm_sql (sql2): There are no DB handles to use!
radius_xlat:  ''
rlm_sqlcounter: (Check item - counter) is greater than zero
rlm_sqlcounter: Authorized user z000057, check_item=600, counter=0
rlm_sqlcounter: Sent Reply-Item for user z000057, Type=Session-Timeout,
value=600
  modcall[authorize]: module "noresetcounter2" returns ok
modcall: group group returns ok



- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to