New build path variable
[freeradius.git] / man / man5 / rlm_sql.5
1 .\"     # DS - begin display
2 .de DS
3 .RS
4 .nf
5 .sp
6 ..
7 .\"     # DE - end display
8 .de DE
9 .fi
10 .RE
11 .sp
12 ..
13 .TH rlm_sql 5 "5 February 2004" "" "FreeRADIUS Module"
14 .SH NAME
15 rlm_sql \- FreeRADIUS Module
16 .SH DESCRIPTION
17 The \fIrlm_sql\fP module provides an SQL interface to retrieve
18 authorization information and store accounting information.  It can be
19 used in conjunction with, or in lieu of the files and detail modules.
20 The SQL module has drivers to support the following SQL databases:
21 .PP
22 .DS
23 .br
24      db2
25 .br
26      iodbc
27 .br
28      mysql
29 .br
30      oracle
31 .br
32      postgresql
33 .br
34      sybase
35 .br
36      unixodbc
37 .br
38 .DE
39 .PP
40 Due to the size of the configuration variables, the sql module is
41 usually configured in a separate file, which is included in the main
42 radiusd.conf via an include directive.
43 .PP
44 The main configuration items to be aware of are:
45 .IP driver
46 This variable specifies the driver to be loaded.
47 .IP server
48 .IP login
49 .IP password
50 These specify the servername, username, and password the module will
51 use to connect to the database.
52 .IP radius_db
53 The name of the database where the radius tables are stored.
54 .IP acct_table1
55 .IP acct_table2
56 These specify the tables names for accounting records.  acct_table1
57 specifies the table where Start records are stored.  acct_table2
58 specifies the table where Stop records are stored.  In most cases,
59 this should be the same table.
60 .IP postauth_table
61 The name of the table to store post-authentication data.
62 .IP authcheck_table
63 .IP authreply_table
64 The tables where individual Check-Items and Reply-Items are stored.
65 .IP groupcheck_table
66 .IP groupreply_table
67 The tables where group Check-Items and Reply-Items are stored.
68 .IP usergroup_table
69 The table where username to group relationships are stored.
70 .IP deletestatlesessions
71 This option is set to 'yes' or 'no'.  If you are doing
72 Simultaneous-Use checking, and this is set to yes, stale sessions (
73 defined as sessions for which a Stop record was not received ) will be
74 cleared.
75 .IP sqltrace
76 .IP sqltracefile
77 These two options are useful for debugging sql problems.  If sqltrace
78 is set to yes, then all sql queries being executed are written to the
79 file listed in sqltracefile.  This is disabled in normal operation.
80 .IP num_sql_socks
81 The number of sql connections to make to the database.
82 .IP connect_failure_retry_delay
83 The number of seconds to wait before attempting to reconnect to a
84 failed database connection.
85 .IP sql_user_name
86 This is the definition of the SQL-User-Name attribute.  This is set
87 once, so that you can use %{SQL-User-Name} in the SQL queries, rather
88 than the nested username substitution.  This ensures that Username is
89 parsed consistently for all SQL queries executed.
90 .IP default_user_profile
91 This is the default profile name that will be applied to all users if
92 set.  This is not set by default.
93 .IP query_on_not_found
94 This option is set to 'yes' or 'no'.  If set to yes, then the default
95 user profile is returned if no specific match was found for the user.
96 .IP authorize_check_query
97 .IP authorize_reply_query
98 These queries are run during the authorization stage to extract the
99 user authorization information from the ${authcheck_table} and
100 ${authreply_table}.
101 .IP authorize_group_check_query
102 .IP authorize_group_reply_query
103 These queries are run during the authorization stage to extract the
104 group authorization information from the ${groupcheck_table} and
105 ${groupreply_table}.
106 .IP accounting_onoff_query
107 The query to be run when receiving an Accounting On or Accounting Off
108 packet.
109 .IP accounting_update_query
110 .IP accounting_update_query_alt
111 The query to be run when receiving an Accounting Update packet.  If the
112 primary query fails, the alt query is run.
113 .IP accounting_start_query
114 .IP accounting_start_query_alt
115 The query to be run when receiving an Accounting Start packet.  If the
116 primary query fails, the alt query is run.
117 .IP accounting_stop_query
118 .IP accounting_stop_query_alt
119 The query to be run when receiving an Accounting Stop packet.  If the
120 primary query fails, the alt query is run.
121 .IP simul_count_query
122 The query to be run to return the number simultaneous sessions for the
123 purposes of limiting Simultaneous Use.
124 .IP simul_verify_query
125 The query to return the detail information needed to confirm that all
126 suspected connected sessions are valid, and are not stale sessions.
127 .IP group_membership_query
128 The query to run to check user group membership.
129 .IP postauth_query
130 The query to run during the post-authentication stage.
131 .SH CONFIGURATION
132 .PP
133 Due to the size of the configuration for this module, it is not
134 included in this manual page.  Please review the supplied
135 configuration files for example queries and configuration details.
136 .SH SECTIONS
137 .BR authorization,
138 .BR accounting,
139 .BR checksimul,
140 .BR post-authentication
141 .PP
142 .SH FILES
143 .I /etc/raddb/radiusd.conf,
144 .I /etc/raddb/sql.conf,
145 .I /etc/raddb/sql/<DB>/dialup.conf,
146 .I /etc/raddb/sql/<DB>/schema.sql,
147 .BR
148 .PP
149 .SH "SEE ALSO"
150 .BR radiusd (8),
151 .BR radiusd.conf (5),
152 .SH AUTHORS
153 Chris Parker, cparker@segv.org