rlm_perl and accounting
Justin Church
jcc at unc.edu
Mon Sep 25 22:07:22 CEST 2006
I've been playing with freeradius version that contains the patch
discussed in this thread, and I'm not receiving any Account-Response
packets from the server, even though the request seems to be logged
correctly. Here's my radiusd -X for my test packet:
jcc at rtc306:/usr/local/share/freeradius$ sudo radiusd -X
Config: including file: /usr/local/etc/raddb/radiusd.conf
Config: including file: /usr/local/etc/raddb/proxy.conf
Config: including file: /usr/local/etc/raddb/clients.conf
Config: including file: /usr/local/etc/raddb/snmp.conf
Config: including file: /usr/local/etc/raddb/eap.conf
Config: including file: /usr/local/etc/raddb/sql.conf
Config: including file: /usr/local/etc/raddb/sql/mysql-dialup.conf
FreeRADIUS Version 2.0.0-pre0, for host i686-pc-linux-gnu, built on Sep
6 2006 at 16:44:16
Starting - reading configuration files ...
read_config_files: reading dictionary
main: prefix = "/usr/local"
main: localstatedir = "/usr/local/var"
main: logdir = "/usr/local/var/log/radius"
main: libdir = "/usr/local/lib"
main: radacctdir = "/usr/local/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: allow_core_dumps = no
main: log_stripped_names = no
main: log_file = "/usr/local/var/log/radius/radius.log"
main: log_auth = no
main: log_auth_badpass = no
main: log_auth_goodpass = no
main: pidfile = "/usr/local/var/run/radiusd/radiusd.pid"
main: checkrad = "/usr/local/sbin/checkrad"
main: debug_level = 0
main: proxy_requests = yes
log: syslog_facility = "daemon"
proxy: retry_delay = 5
proxy: retry_count = 3
proxy: default_fallback = yes
proxy: dead_time = 120
proxy: wake_all_if_all_dead = no
security: max_attributes = 200
security: reject_delay = 1
security: status_server = no
read_config_files: reading realms
main: port = 1812
listen: type = "auth"
listen: ipaddr = *
listen: port = 0
listen: type = "acct"
listen: ipaddr = *
listen: port = 0
client: secret = "testing123"
client: shortname = "localhost"
client: nastype = "other"
client: secret = "testing123"
client: shortname = "localhost"
client: secret = "testing123"
client: shortname = "jcc-pc"
radiusd: entering modules setup
Module: Library search path is /usr/local/lib
Module: Loaded exec
exec: wait = yes
exec: input_pairs = "request"
exec: shell_escape = yes
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 expiration
expiration: reply-message = "Password Has Expired "
Module: Instantiated expiration (expiration)
Module: Loaded logintime
logintime: reply-message = "You are calling outside your allowed
timespan "
logintime: minimum-timeout = 60
Module: Instantiated logintime (logintime)
Module: Loaded PAP
pap: encryption_scheme = "auto"
pap: auto_header = no
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
Module: Instantiated mschap (mschap)
Module: Loaded System
unix: radwtmp = "/usr/local/var/log/radius/radwtmp"
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 = "/usr/local/etc/raddb/huntgroups"
preprocess: hints = "/usr/local/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 = no
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 files
files: usersfile = "/usr/local/etc/raddb/users"
files: acctusersfile = "/usr/local/etc/raddb/acct_users"
files: preproxy_usersfile = "/usr/local/etc/raddb/preproxy_users"
files: compat = "no"
Module: Instantiated files (files)
Module: Loaded Acct-Unique-Session-Id
acct_unique: key = "User-Name, Acct-Session-Id, NAS-IP-Address,
Client-IP-Address, NAS-Port"
Module: Instantiated acct_unique (acct_unique)
Module: Loaded perl
perl: module = "/usr/local/etc/raddb/ami_handler.pl"
perl: func_authorize = "authorize"
perl: func_authenticate = "authenticate"
perl: func_accounting = "accounting"
perl: func_preacct = "preacct"
perl: func_checksimul = "checksimul"
perl: func_detach = "detach"
perl: func_xlat = "xlat"
perl: func_pre_proxy = "pre_proxy"
perl: func_post_proxy = "post_proxy"
perl: func_post_auth = "post_auth"
perl: max_clones = 32
perl: start_clones = 5
perl: min_spare_clones = 3
perl: max_spare_clones = 3
perl: cleanup_delay = 5
perl: max_request_per_clone = 0
Module: Instantiated perl (perl)
Module: Loaded detail
detail: detailfile =
"/usr/local/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d"
detail: header = "%t"
detail: detailperm = 384
detail: dirperm = 493
detail: locking = no
detail: log_packet_header = no
Module: Instantiated detail (local-detail)
detail: detailfile = "/usr/local/var/log/radius/radacct/radrelay-detail"
detail: header = "%t"
detail: detailperm = 384
detail: dirperm = 493
detail: locking = yes
detail: log_packet_header = no
Module: Instantiated detail (radrelay-detail)
Module: Loaded radutmp
radutmp: filename = "/usr/local/var/log/radius/radutmp"
radutmp: username = "%{User-Name}"
radutmp: case_sensitive = yes
radutmp: check_with_nas = yes
radutmp: perm = 384
radutmp: callerid = yes
Module: Instantiated radutmp (radutmp)
Initializing the thread pool...
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on proxy address * port 1814
Ready to process requests.
Nothing to do. Sleeping until we see a request.
rad_recv: Accounting-Request packet from host 152.2.199.26 port 32813,
id=35, length=65
User-Name = "jcc"
NAS-Port = 1
Acct-Session-Id = "accounting-session-1"
Sip-Transport-Proto = TLS
Processing the preacct section of radiusd.conf
modcall: entering group preacct for request 0
rlm_acct_unique: WARNING: Attribute Client-IP-Address was not found in
request, unique ID MAY be inconsistent
rlm_acct_unique: Hashing 'NAS-Port = 1,,NAS-IP-Address =
152.2.199.26,Acct-Session-Id = "accounting-session-1",User-Name = "jcc"'
rlm_acct_unique: Acct-Unique-Session-ID = "b9953681ea576605".
perl_pool: item 0x8185d50 asigned new request. Handled so far: 1
found interpetator at address 0x8185d50
rlm_perl: Added pair User-Name = jcc
rlm_perl: Added pair Acct-Session-Id = accounting-session-1
rlm_perl: Added pair Sip-Transport-Proto = TLS
rlm_perl: Added pair Acct-Unique-Session-Id = b9953681ea576605
rlm_perl: Added pair Calling-Station-Id = jcc-church at unc.edu
rlm_perl: Added pair NAS-IP-Address = 152.2.199.26
rlm_perl: Added pair NAS-Port = 1
perl_pool total/active/spare [5/0/5]
Could not get @DynaLoader::dl_librefs for unloading.
Unreserve perl at address 0x8185d50
rlm_realm: No '@' in User-Name = "", looking up realm NULL
rlm_realm: No such realm "NULL"
modcall: group preacct returns noop for request 0
Processing the accounting section of radiusd.conf
modcall: entering group accounting for request 0
radius_xlat:
'/usr/local/var/log/radius/radacct/152.2.199.26/detail-20060925'
rlm_detail:
/usr/local/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d
expands to /usr/local/var/log/radius/radacct/152.2.199.26/detail-20060925
radius_xlat: 'Mon Sep 25 16:05:13 2006'
radius_xlat: '/usr/local/var/log/radius/radacct/radrelay-detail'
rlm_detail: /usr/local/var/log/radius/radacct/radrelay-detail expands to
/usr/local/var/log/radius/radacct/radrelay-detail
rlm_detail: Acquired filelock, tried 1 time(s)
radius_xlat: 'Mon Sep 25 16:05:13 2006'
rlm_detail: Released filelock
rlm_unix: no Accounting-Status-Type attribute in request.
rlm_radutmp: No Accounting-Status-Type record.
modcall: group accounting returns noop for request 0
Finished request 0
Going to the next request
--- Walking the entire request list ---
Cleaning up request 0 ID 35 with timestamp 45183679
Nothing to do. Sleeping until we see a request.
Anything in this debug indicate why the server doesn't send
Accounting-Response?
Thanks.
-jc
Alan DeKok wrote:
> Peter Nixon <listuser at peternixon.net> wrote:
>> That would seem like th logical way to do it, and would certainly make the
>> perl code clearer..
>
> Ok. Unless Boian Jordanov has concerns, I'll commit a patch in a
> few days.
>
> Alan DeKok.
> --
> http://deployingradius.com - The web site of the book
> http://deployingradius.com/blog/ - The blog
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list