sql_log in 3.0.10

Wegener, Norbert norbert.wegener at atos.net
Fri Oct 9 14:49:22 CEST 2015


Having used an ancient version of FR up to now I just look into 3.0.10. I started with a fresh install and activated sql in default, to get the functionality of the former sql_log module.
Additionally I  enabled logfile in mods-available/sql and linked the file to mods-enabled.

    # Write SQL queries to a logfile. This is potentially useful for tracing
    # issues with authorization queries.
logfile = ${logdir}/sqllog.sql

I hope the following part of the logs are sufficient. I did not want to post 900 lines here. If necessary I can provide the complete log.

radius obviously sees this directive on startup:
radius -X
.....
.....
# Loading module "sql" from file /home/dop/tests/freeradius-server-3.0.10/etc/raddb/mods-enabled/sql^M
  sql {^M
    driver = "rlm_sql_null"^M
    server = ""^M
    port = 0^M
    login = ""^M
    password = <<< secret >>>^M
    radius_db = "radius"^M
    read_groups = yes^M
    read_profiles = yes^M
    read_clients = no^M
    delete_stale_sessions = yes^M
    sql_user_name = "%{User-Name}"^M
    logfile = "/home/dop/tests/freeradius-server-3.0.10/var/log/radius/sqllog.sql"^M
    default_user_profile = ""^M
.....

Firering up radtest with bob and hello, I get an Access-Accept.
I would have expected to see a line in the logfile now, but no logfile is to be found and
also in the post-auth part of the radius' debug output I do not see any anything that looks like writing to a file, instead:

(0) # Executing section post-auth from file /home/dop/tests/freeradius-server-3.0.10/etc/raddb/sites-enabled/default^M
(0)   post-auth {^M
(0)     update {^M
(0)       No attributes updated^M
(0)     } # update = noop^M
(0) sql: EXPAND .query^M
(0) sql:    --> .query^M
(0) sql: Using query template 'query'^M
rlm_sql (sql): Reserved connection (1)^M
(0) sql: EXPAND %{User-Name}^M
(0) sql:    --> bob^M
(0) sql: SQL-User-Name set to 'bob'^M
(0) sql: EXPAND INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '%{SQL-User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', '%S')^M
(0) sql:    --> INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( 'bob', 'hello', 'Access-Accept', '2015-10-09 11:52:21')^M
(0) sql: Executing query: INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( 'bob', 'hello', 'Access-Accept', '2015-10-09 11:52:21')^M
(0) sql: SQL query returned: success^M
(0) sql: 1 record(s) updated^M
rlm_sql (sql): Released connection (1)^M
(0)     [sql] = ok^M

The logfile will also not be written, when running radius in daemon mode.
Do I have to change the config elsewhere for this ?

Norbert




More information about the Freeradius-Users mailing list