Fix changelog syntax
[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 logfile
76 This option is useful for debugging sql problems.  If logfile is set
77 then all sql queries for the containing section are written to the
78 file specified.  This is useful for debugging and bulk inserts.
79 .IP num_sql_socks
80 The number of sql connections to make to the database.
81 .IP connect_failure_retry_delay
82 The number of seconds to wait before attempting to reconnect to a
83 failed database connection.
84 .IP sql_user_name
85 This is the definition of the SQL-User-Name attribute.  This is set
86 once, so that you can use %{SQL-User-Name} in the SQL queries, rather
87 than the nested username substitution.  This ensures that Username is
88 parsed consistently for all SQL queries executed.
89 .IP default_user_profile
90 This is the default profile name that will be applied to all users if
91 set.  This is not set by default.
92 .IP query_on_not_found
93 This option is set to 'yes' or 'no'.  If set to yes, then the default
94 user profile is returned if no specific match was found for the user.
95 .IP authorize_check_query
96 .IP authorize_reply_query
97 These queries are run during the authorization stage to extract the
98 user authorization information from the ${authcheck_table} and
99 ${authreply_table}.
100 .IP authorize_group_check_query
101 .IP authorize_group_reply_query
102 These queries are run during the authorization stage to extract the
103 group authorization information from the ${groupcheck_table} and
104 ${groupreply_table}.
105 .IP accounting_onoff_query
106 The query to be run when receiving an Accounting On or Accounting Off
107 packet.
108 .IP accounting_update_query
109 .IP accounting_update_query_alt
110 The query to be run when receiving an Accounting Update packet.  If the
111 primary query fails, the alt query is run.
112 .IP accounting_start_query
113 .IP accounting_start_query_alt
114 The query to be run when receiving an Accounting Start packet.  If the
115 primary query fails, the alt query is run.
116 .IP accounting_stop_query
117 .IP accounting_stop_query_alt
118 The query to be run when receiving an Accounting Stop packet.  If the
119 primary query fails, the alt query is run.
120 .IP simul_count_query
121 The query to be run to return the number simultaneous sessions for the
122 purposes of limiting Simultaneous Use.
123 .IP simul_verify_query
124 The query to return the detail information needed to confirm that all
125 suspected connected sessions are valid, and are not stale sessions.
126 .IP group_membership_query
127 The query to run to check user group membership.
128 .IP postauth_query
129 The query to run during the post-authentication stage.
130 .SH CONFIGURATION
131 .PP
132 Due to the size of the configuration for this module, it is not
133 included in this manual page.  Please review the supplied
134 configuration files for example queries and configuration details.
135 .SH SECTIONS
136 .BR authorization,
137 .BR accounting,
138 .BR checksimul,
139 .BR post-authentication
140 .PP
141 .SH FILES
142 .I /etc/raddb/radiusd.conf,
143 .I /etc/raddb/sql.conf,
144 .I /etc/raddb/sql/<DB>/dialup.conf,
145 .I /etc/raddb/sql/<DB>/schema.sql,
146 .BR
147 .PP
148 .SH "SEE ALSO"
149 .BR radiusd (8),
150 .BR radiusd.conf (5),
151 .SH AUTHORS
152 Chris Parker, cparker@segv.org