How do I Instruct Freeradius to connect to postgreSQL Database on a port other than 5432?

justice obrey justopee at yahoo.com
Tue Sep 11 21:30:09 CEST 2007


All,
  The PostgreSQL database that I want my freeradius-1.1.7 to connect to is running on a port different from the default 5432 and beacause of this, Freeradius is not not able to connect to the database.
  How do I change my fFreeradius configuration to instruct it to to the postgresql database on a port say 5490? It is the rlm_sql_postgresql driver that fails in doing this connection.
  Thanks for any suggestions.
   
  Below is the debug:
   
  root at dev-radius:~# /opt/freeradius/sbin/radiusd -X
Starting - reading configuration files ...
reread_config:  reading radiusd.conf
Config:   including file: /opt/freeradius/etc/raddb/proxy.conf
Config:   including file: /opt/freeradius/etc/raddb/clients.conf
Config:   including file: /opt/freeradius/etc/raddb/snmp.conf
Config:   including file: /opt/freeradius/etc/raddb/eap.conf
Config:   including file: /opt/freeradius/etc/raddb/postgresql.conf
 main: prefix = "/opt/freeradius"
 main: localstatedir = "/opt/freeradius/var"
 main: logdir = "/opt/freeradius/var/log/radius"
 main: libdir = "/opt/freeradius/lib"
 main: radacctdir = "/opt/freeradius/var/log/radius/radacct"
 main: hostname_lookups = no
 main: max_request_time = 30
 main: cleanup_delay = 5
 main: max_requests = 1024
 main: delete_blocked_requests = 0
 main: port = 0
 main: allow_core_dumps = no
 main: log_stripped_names = no
 main: log_file = "/opt/freeradius/var/log/radius/radius.log"
 main: log_auth = no
 main: log_auth_badpass = no
 main: log_auth_goodpass = no
 main: pidfile = "/opt/freeradius/var/run/radiusd/radiusd.pid"
 main: user = "(null)"
 main: group = "(null)"
 main: usercollide = no
 main: lower_user = "no"
 main: lower_pass = "no"
 main: nospace_user = "no"
 main: nospace_pass = "no"
 main: checkrad = "/opt/freeradius/sbin/checkrad"
 main: proxy_requests = yes
 proxy: retry_delay = 5
 proxy: retry_count = 3
 proxy: synchronous = no
 proxy: default_fallback = yes
 proxy: dead_time = 120
 proxy: post_proxy_authorize = no
 proxy: wake_all_if_all_dead = no
 security: max_attributes = 200
 security: reject_delay = 1
 security: status_server = no
 main: debug_level = 0
read_config_files:  reading dictionary
read_config_files:  reading naslist
Using deprecated naslist file.  Support for this will go away soon.
read_config_files:  reading clients
read_config_files:  reading realms
radiusd:  entering modules setup
Module: Library search path is /opt/freeradius/lib
Module: Loaded exec 
 exec: wait = yes
 exec: program = "(null)"
 exec: input_pairs = "request"
 exec: output_pairs = "(null)"
 exec: packet_type = "(null)"
rlm_exec: Wait=yes but no output defined. Did you mean output=none?
Module: Instantiated exec (exec) 
Module: Loaded expr 
Module: Instantiated expr (expr) 
Module: Loaded PAP 
 pap: encryption_scheme = "crypt"
 pap: auto_header = yes
Module: Instantiated pap (pap) 
Module: Loaded CHAP 
Module: Instantiated chap (chap) 
Module: Loaded MS-CHAP 
 mschap: use_mppe = yes
 mschap: require_encryption = no
 mschap: require_strong = no
 mschap: with_ntdomain_hack = no
 mschap: passwd = "(null)"
 mschap: ntlm_auth = "(null)"
Module: Instantiated mschap (mschap) 
Module: Loaded System 
 unix: cache = no
 unix: passwd = "(null)"
 unix: shadow = "(null)"
 unix: group = "(null)"
 unix: radwtmp = "/opt/freeradius/var/log/radius/radwtmp"
 unix: usegroup = no
 unix: cache_reload = 600
Module: Instantiated unix (unix) 
Module: Loaded eap 
 eap: default_eap_type = "md5"
 eap: timer_expire = 60
 eap: ignore_unknown_eap_types = no
 eap: cisco_accounting_username_bug = no
rlm_eap: Loaded and initialized type md5
rlm_eap: Loaded and initialized type leap
 gtc: challenge = "Password: "
 gtc: auth_type = "PAP"
rlm_eap: Loaded and initialized type gtc
 mschapv2: with_ntdomain_hack = no
rlm_eap: Loaded and initialized type mschapv2
Module: Instantiated eap (eap) 
Module: Loaded preprocess 
 preprocess: huntgroups = "/opt/freeradius/etc/raddb/huntgroups"
 preprocess: hints = "/opt/freeradius/etc/raddb/hints"
 preprocess: with_ascend_hack = no
 preprocess: ascend_channels_per_line = 23
 preprocess: with_ntdomain_hack = no
 preprocess: with_specialix_jetstream_hack = no
 preprocess: with_cisco_vsa_hack = yes
 preprocess: with_alvarion_vsa_hack = no
Module: Instantiated preprocess (preprocess) 
Module: Loaded realm 
 realm: format = "suffix"
 realm: delimiter = "@"
 realm: ignore_default = no
 realm: ignore_null = no
Module: Instantiated realm (suffix) 
Module: Loaded SQL 
 sql: driver = "rlm_sql_postgresql"
 sql: server = "localhost"
 sql: port = ""
 sql: login = "postgres"
 sql: password = ""
 sql: radius_db = "radiusdb"
 sql: nas_table = "nas"
 sql: sqltrace = yes
 sql: sqltracefile = "/opt/freeradius/var/log/radius/sqltrace.sql"
 sql: readclients = yes
 sql: deletestalesessions = yes
 sql: num_sql_socks = 25
 sql: sql_user_name = "%{User-Name}"
 sql: default_user_profile = ""
 sql: query_on_not_found = no
 sql: authorize_check_query = "SELECT id, UserName, Attribute, Value, Op ??FROM radcheck ??WHERE Username = '%{SQL-User-Name}' ??ORDER BY id"
 sql: authorize_reply_query = "SELECT id, UserName, Attribute, Value, Op ??FROM radreply ??WHERE Username = '%{SQL-User-Name}' ??ORDER BY id"
 sql: authorize_group_check_query = "SELECT radgroupcheck.id, radgroupcheck.GroupName, ??radgroupcheck.Attribute, radgroupcheck.Value,radgroupcheck.Op ??FROM radgroupcheck, usergroup ??WHERE usergroup.Username = '%{SQL-User-Name}' AND usergroup.GroupName = radgroupcheck.GroupName ??ORDER BY radgroupcheck.id"
 sql: authorize_group_reply_query = "SELECT radgroupreply.id, radgroupreply.GroupName, radgroupreply.Attribute, ??radgroupreply.Value, radgroupreply.Op ??FROM radgroupreply,usergroup ??WHERE usergroup.Username = '%{SQL-User-Name}' AND usergroup.GroupName = radgroupreply.GroupName ??ORDER BY radgroupreply.id"
 sql: accounting_onoff_query = "UPDATE radacct   SET AcctStopTime = ('%S'::timestamp - '%{Acct-Delay-Time:-0}'::interval),   AcctSessionTime = (EXTRACT(EPOCH FROM('%S'::timestamp with time zone -                     AcctStartTime::timestamp with time zone -                     '%{Acct-Delay-Time:-0}'::interval)))::BIGINT,   AcctTerminateCause='%{Acct-Terminate-Cause}',   AcctStopDelay = 0   WHERE AcctSessionTime IS NULL   AND AcctStopTime IS NULL   AND NASIPAddress= '%{NAS-IP-Address}'   AND AcctStartTime <= '%S'::timestamp"
 sql: accounting_update_query = "UPDATE radacct   SET FramedIPAddress = NULLIF('%{Framed-IP-Address}', '')::inet,   AcctSessionTime = (EXTRACT(EPOCH FROM('%S'::timestamp with time zone -                     AcctStartTime::timestamp with time zone -                     '%{Acct-Delay-Time:-0}'::interval)))::BIGINT,   AcctInputOctets = (('%{Acct-Input-Gigawords:-0}'::bigint << 32) +                     '%{Acct-Input-Octets:-0}'::bigint),   AcctOutputOctets = (('%{Acct-Output-Gigawords:-0}'::bigint << 32) +                     '%{Acct-Output-Octets:-0}'::bigint)   WHERE AcctSessionId = '%{Acct-Session-Id}'   AND UserName = '%{SQL-User-Name}'   AND NASIPAddress= '%{NAS-IP-Address}'   AND AcctStopTime IS NULL"
 sql: accounting_update_query_alt = "INSERT into radacct   (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime,   AcctSessionTime, AcctAuthentic, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, ??ServiceType, FramedProtocol, FramedIPAddress, XAscendSessionSvrKey) ??values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', ??'%{NAS-Port}', '%{NAS-Port-Type}',                 ('%S'::timestamp -  '%{Acct-Delay-Time:-0}'::interval - '%{Acct-Session-Time:-0}'::interval), ??'%{Acct-Session-Time}', '%{Acct-Authentic}', ??(('%{Acct-Input-Gigawords:-0}'::bigint << 32) + '%{Acct-Input-Octets:-0}'::bigint), ??(('%{Acct-Output-Gigawords:-0}'::bigint << 32) + '%{Acct-Output-Octets:-0}'::bigint), '%{Called-Station-Id}', ??'%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', ??NULLIF('%{Framed-IP-Address}', '')::inet, '%{X-Ascend-Session-Svr-Key}')"
 sql: accounting_start_query = "INSERT into radacct ??(AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctAuthentic, ??ConnectInfo_start, CalledStationId, CallingStationId, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, XAscendSessionSvrKey) ??values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', ??'%{NAS-Port}', '%{NAS-Port-Type}', ('%S'::timestamp - '%{Acct-Delay-Time:-0}'::interval), '%{Acct-Authentic}', '%{Connect-Info}', ??'%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', ??NULLIF('%{Framed-IP-Address}', '')::inet, 0, '%{X-Ascend-Session-Svr-Key}')"
 sql: accounting_start_query_alt = "UPDATE radacct ??SET AcctStartTime = ('%S'::timestamp - '%{Acct-Delay-Time:-0}'::interval), AcctStartDelay = 0, ??ConnectInfo_start = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' ??AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStopTime IS NULL"
 sql: accounting_stop_query = "UPDATE radacct ??SET AcctStopTime = ('%S'::timestamp - '%{Acct-Delay-Time:-0}'::interval), ??AcctSessionTime = NULLIF('%{Acct-Session-Time}', '')::bigint, ??AcctInputOctets = (('%{Acct-Input-Gigawords:-0}'::bigint << 32) + '%{Acct-Input-Octets:-0}'::bigint), ??AcctOutputOctets = (('%{Acct-Output-Gigawords:-0}'::bigint << 32) + '%{Acct-Output-Octets:-0}'::bigint), ??AcctTerminateCause = '%{Acct-Terminate-Cause}', AcctStopDelay = 0, ??FramedIPAddress = NULLIF('%{Framed-IP-Address}', '')::inet, ConnectInfo_stop = '%{Connect-Info}' ??WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' ??AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStopTime IS NULL"
 sql: accounting_stop_query_alt = "INSERT into radacct ??(AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, ??AcctSessionTime, AcctAuthentic, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, ??AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStopDelay) ??values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', ??'%{NAS-Port}', '%{NAS-Port-Type}', ('%S'::timestamp -  '%{Acct-Delay-Time:-0}'::interval - '%{Acct-Session-Time:-0}'::interval), ??('%S'::timestamp - '%{Acct-Delay-Time:-0}'::interval), NULLIF('%{Acct-Session-Time}', '')::bigint, ??'%{Acct-Authentic}', '%{Connect-Info}', ??(('%{Acct-Input-Gigawords:-0}'::bigint << 32) + '%{Acct-Input-Octets:-0}'::bigint), ??(('%{Acct-Output-Gigawords:-0}'::bigint << 32) + '%{Acct-Output-Octets:-0}'::bigint), '%{Called-Station-Id}', ??'%{Calling-Station-Id}',
 '%{Acct-Terminate-Cause}', '%{Service-Type}', '%{Framed-Protocol}', ??NULLIF('%{Framed-IP-Address}', '')::inet, 0)"
 sql: group_membership_query = "SELECT GroupName FROM usergroup WHERE UserName='%{SQL-User-Name}'"
 sql: connect_failure_retry_delay = 60
 sql: simul_count_query = ""
 sql: simul_verify_query = ""
 sql: postauth_query = "INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ('%{User-Name}', '%{User-Password:-Chap-Password}', '%{reply:Packet-Type}', NOW())"
 sql: safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
rlm_sql (sql): Driver rlm_sql_postgresql (module rlm_sql_postgresql) loaded and linked
rlm_sql (sql): Attempting to connect to postgres at localhost:/radiusdb
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #0
rlm_sql_postgresql: Couldn't connect socket to PostgreSQL server postgres at localhost:radiusdb
rlm_sql_postgresql: Postgresql error 'could not connect to server: Connection refused ?Is the server running on host "localhost" and accepting ?TCP/IP connections on port 5432? '
rlm_sql (sql): Failed to connect DB handle #0
rlm_sql (sql): starting 1
rlm_sql (sql): starting 2
rlm_sql (sql): starting 3
rlm_sql (sql): starting 4
rlm_sql (sql): starting 5
rlm_sql (sql): starting 6
rlm_sql (sql): starting 7
rlm_sql (sql): starting 8
rlm_sql (sql): starting 9
rlm_sql (sql): starting 10
rlm_sql (sql): starting 11
rlm_sql (sql): starting 12
rlm_sql (sql): starting 13
rlm_sql (sql): starting 14
rlm_sql (sql): starting 15
rlm_sql (sql): starting 16
rlm_sql (sql): starting 17
rlm_sql (sql): starting 18
rlm_sql (sql): starting 19
rlm_sql (sql): starting 20
rlm_sql (sql): starting 21
rlm_sql (sql): starting 22
rlm_sql (sql): starting 23
rlm_sql (sql): starting 24
rlm_sql (sql): Failed to connect to any SQL server.
rlm_sql (sql): - generate_sql_clients
rlm_sql (sql): Query: SELECT * FROM nas
rlm_sql (sql): Ignoring unconnected handle 24..
rlm_sql (sql): Ignoring unconnected handle 23..
rlm_sql (sql): Ignoring unconnected handle 22..
rlm_sql (sql): Ignoring unconnected handle 21..
rlm_sql (sql): Ignoring unconnected handle 20..
rlm_sql (sql): Ignoring unconnected handle 19..
rlm_sql (sql): Ignoring unconnected handle 18..
rlm_sql (sql): Ignoring unconnected handle 17..
rlm_sql (sql): Ignoring unconnected handle 16..
rlm_sql (sql): Ignoring unconnected handle 15..
rlm_sql (sql): Ignoring unconnected handle 14..
rlm_sql (sql): Ignoring unconnected handle 13..
rlm_sql (sql): Ignoring unconnected handle 12..
rlm_sql (sql): Ignoring unconnected handle 11..
rlm_sql (sql): Ignoring unconnected handle 10..
rlm_sql (sql): Ignoring unconnected handle 9..
rlm_sql (sql): Ignoring unconnected handle 8..
rlm_sql (sql): Ignoring unconnected handle 7..
rlm_sql (sql): Ignoring unconnected handle 6..
rlm_sql (sql): Ignoring unconnected handle 5..
rlm_sql (sql): Ignoring unconnected handle 4..
rlm_sql (sql): Ignoring unconnected handle 3..
rlm_sql (sql): Ignoring unconnected handle 2..
rlm_sql (sql): Ignoring unconnected handle 1..
rlm_sql (sql): Ignoring unconnected handle 0..
rlm_sql (sql): There are no DB handles to use! skipped 25, tried to connect 0
rlm_sql (sql): generate_sql_clients() returned error
rlm_sql (sql): Closing sqlsocket 24
rlm_sql (sql): Closing sqlsocket 23
rlm_sql (sql): Closing sqlsocket 22
rlm_sql (sql): Closing sqlsocket 21
rlm_sql (sql): Closing sqlsocket 20
rlm_sql (sql): Closing sqlsocket 19
rlm_sql (sql): Closing sqlsocket 18
rlm_sql (sql): Closing sqlsocket 17
rlm_sql (sql): Closing sqlsocket 16
rlm_sql (sql): Closing sqlsocket 15
rlm_sql (sql): Closing sqlsocket 14
rlm_sql (sql): Closing sqlsocket 13
rlm_sql (sql): Closing sqlsocket 12
rlm_sql (sql): Closing sqlsocket 11
rlm_sql (sql): Closing sqlsocket 10
rlm_sql (sql): Closing sqlsocket 9
rlm_sql (sql): Closing sqlsocket 8
rlm_sql (sql): Closing sqlsocket 7
rlm_sql (sql): Closing sqlsocket 6
rlm_sql (sql): Closing sqlsocket 5
rlm_sql (sql): Closing sqlsocket 4
rlm_sql (sql): Closing sqlsocket 3
rlm_sql (sql): Closing sqlsocket 2
rlm_sql (sql): Closing sqlsocket 1
rlm_sql (sql): Closing sqlsocket 0


       
---------------------------------
Boardwalk for $500? In 2007? Ha! 
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20070911/87c2ecf4/attachment.html>


More information about the Freeradius-Users mailing list