problem with rlm_counter module when reset option is set to never
Hi all, Here is the issue I am facing with rlm_counter module. I am using freeradius-server-2.1.4 and configuring Max session time for each user. for example: user1 Max-Session-Time := 1800, Auth-Type := Reject Reply-Message = "Your time limit is used" user2 Max-Session-Time := 3600, Auth-Type := Reject Reply-Message = "Your time limit is used" and rlm_counter options are : counter daily { counter-name = Max-All-Session-Time check-name = Max-All-Session key = User-Name reset = never } I am observing that the user accounting record is not deleted from rlm_counter module once the user has used his allocated time. For example when user1 has used 1800 seconds allocated to him then I will be deleting the user from users config and then add the same user back. I am getting the "Your time limit is used" message :(. Does somebody has information about how to delete the records from rlm_counter module once they are expired with reset-option set to never. Regards Ahmed Nifaz
Here is the issue I am facing with rlm_counter module. I am using freeradius-server-2.1.4 and configuring Max session time for each user.
for example: user1 Max-Session-Time := 1800, Auth-Type := Reject Reply-Message = "Your time limit is used"
user2 Max-Session-Time := 3600, Auth-Type := Reject Reply-Message = "Your time limit is used"
and rlm_counter options are :
counter daily { counter-name = Max-All-Session-Time check-name = Max-All-Session key = User-Name reset = never }
I am observing that the user accounting record is not deleted from rlm_counter module once the user has used his allocated time.
And what makes you think it would be.
For example when user1 has used 1800 seconds allocated to him then I will be deleting the user from users config and then add the same user back. I am getting the "Your time limit is used" message :(.
Does somebody has information about how to delete the records from rlm_counter module once they are expired with reset-option set to never.
Yes. Delete accounting records as well when you delete user details. Ivan Kalik Kalik Informatika ISP
Here is the issue I am facing with rlm_counter module. I am using freeradius-server-2.1.4 and configuring Max session time for each user.
for example: user1 Max-Session-Time := 1800, Auth-Type := Reject Reply-Message = "Your time limit is used"
user2 Max-Session-Time := 3600, Auth-Type := Reject Reply-Message = "Your time limit is used"
and rlm_counter options are :
counter daily { counter-name = Max-All-Session-Time check-name = Max-All-Session key = User-Name reset = never }
I am observing that the user accounting record is not deleted from rlm_counter module once the user has used his allocated time.
And what makes you think it would be.
This would increase the accounting file size indefenitely and cause some other problems as the user records are not at all being deleted.
For example when user1 has used 1800 seconds allocated to him then I will be deleting the user from users config and then add the same user back. I am getting the "Your time limit is used" message :(.
Does somebody has information about how to delete the records from rlm_counter module once they are expired with reset-option set to never.
Yes. Delete accounting records as well when you delete user details.
I tried that but that accounting file is in binary or some other encrypted format. Will you please let me know about how to delete that accounting record or how to convert that to simple text file ( which would make easy deleting expired records) . Ahmed Nifaz
Ahmed Nifaz Faizabadi wrote: ....
counter daily { counter-name = Max-All-Session-Time check-name = Max-All-Session key = User-Name reset = never ... I am observing that the user accounting record is not deleted from rlm_counter module once the user has used his allocated time. ... This would increase the accounting file size indefenitely and cause some other problems as the user records are not at all being deleted.
See the configuration: "reset = never" means "never reset". Which means "don't reset".
I tried that but that accounting file is in binary or some other encrypted format. Will you please let me know about how to delete that accounting record or how to convert that to simple text file ( which would make easy deleting expired records) .
It's just a DBM file. See the "rad_counter.pl" file in the source tree. It shows how to edit the file. Alan DeKok.
On Tue, May 26, 2009 at 7:19 PM, Alan DeKok <aland@deployingradius.com> wrote:
Ahmed Nifaz Faizabadi wrote: ....
counter daily { counter-name = Max-All-Session-Time check-name = Max-All-Session key = User-Name reset = never ... I am observing that the user accounting record is not deleted from rlm_counter module once the user has used his allocated time. ... This would increase the accounting file size indefenitely and cause some other problems as the user records are not at all being deleted.
See the configuration: "reset = never" means "never reset". Which means "don't reset".
I agree with your explanation :). But it's a problem.
I tried that but that accounting file is in binary or some other encrypted format. Will you please let me know about how to delete that accounting record or how to convert that to simple text file ( which would make easy deleting expired records) .
It's just a DBM file. See the "rad_counter.pl" file in the source tree. It shows how to edit the file.
I tried deleting using rad_counter.pl, but it doesn't work as gdbm does not allow more than one writer to that file. I guess I need to patch up freeradius where a delete user message (my own defnied) is sent to freeradius from NAS. On recieveing this freeradius would just go and delete the users mentioned in that message. I would be introducing a new listener for that purpose. will that be ok ? I have other option of shutting down freeradius and then delete users using rad_counter.pl, but that would lead to unavailability of service for some time. regards Ahmed Nifaz
I tried that but that accounting file is in binary or some other encrypted format. Will you please let me know about how to delete that accounting record or how to convert that to simple text file ( which would make easy deleting expired records) .
It's just a DBM file. See the "rad_counter.pl" file in the source tree. It shows how to edit the file.
I tried deleting using rad_counter.pl, but it doesn't work as gdbm does not allow more than one writer to that file.
I guess I need to patch up freeradius where a delete user message (my own defnied) is sent to freeradius from NAS. On recieveing this freeradius would just go and delete the users mentioned in that message. I would be introducing a new listener for that purpose. will that be ok ?
Why don't you just increase the limit? Why all this exercise with removing previous records? Ivan Kalik Kalik Informatika ISP
Ahmed Nifaz Faizabadi wrote:
I guess I need to patch up freeradius where a delete user message (my own defnied) is sent to freeradius from NAS.
I really don't think you want to do that.
On recieveing this freeradius would just go and delete the users mentioned in that message. I would be introducing a new listener for that purpose. will that be ok ?
If you write && maintain the software... it's up to you.
I have other option of shutting down freeradius and then delete users using rad_counter.pl, but that would lead to unavailability of service for some time.
Or... use sqlcounter. It uses a database that allows multiple writers. Alan DeKok.
Hi all, I am trying to use the rlm_raw module to test a piece of code. I downloaded freeradius-2.1.7-pre Googling for the rlm_raw module found the module for me on a message somewhere in 2005. I extracted it from the message and dropped it in the modules folder. It does not seem to compile though. (i.e. it's not included) I'm compiling freeradius for debian. simple dpkg-buildpackage. It compiles cleanly, but the rlm_raw modules is not included in the package. (it doesn't exist in /usr/lib/freeradius after installation) Inspecting the rlm_raw folder also shows no .o file, which I assume means the module is ignored. How can I convince dpkg-buildpackage to include/compile rlm_raw. or am I totally on the wrong track here? Thanks! -- Johan Meiring Cape PC Services CC Tel: (021) 883-8271 Fax: (021) 886-7782
Johan Meiring wrote:
Hi all,
I am trying to use the rlm_raw module to test a piece of code.
OK.... After struggling for about 4 hours, I did the following.... 1) touch src/modules/rlm_raw/configure 2) ./autogen.sh 3) added rlm_raw to debian configure by editing debian/rules Now it tries to compile it, but fails horribly. (See compile failure below). Does anyone have a clue how to add rlm_raw to the current git tar file? PS: The rlm_raw I'm using comes from http://lists.cistron.nl/pipermail/freeradius-devel/2005-January/007873.html ------------SNIP-------------- make[6]: Entering directory `/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7/src/modules/rlm_raw' /usr/bin/libtool --mode=compile gcc -Wall -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -I/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7/src -I/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7/libltdl -D_LIBRADIUS -c rlm_raw.c gcc -Wall -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -I/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7/src -I/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7/libltdl -D_LIBRADIUS -c rlm_raw.c -fPIC -DPIC -o .libs/rlm_raw.o rlm_raw.c:22:22: error: autoconf.h: No such file or directory rlm_raw.c:23:23: error: libradius.h: No such file or directory rlm_raw.c:28:21: error: radiusd.h: No such file or directory rlm_raw.c:29:21: error: modules.h: No such file or directory rlm_raw.c:30:22: error: conffile.h: No such file or directory rlm_raw.c:46: error: expected specifier-qualifier-list before ‘uint8_t’ rlm_raw.c:57: error: expected declaration specifiers or ‘...’ before ‘REQUEST’ rlm_raw.c:59: error: expected declaration specifiers or ‘...’ before ‘RADIUS_ESCAPE_STRING’ rlm_raw.c: In function ‘raw_xlat’: rlm_raw.c:61: error: ‘uint8_t’ undeclared (first use in this function) rlm_raw.c:61: error: (Each undeclared identifier is reported only once rlm_raw.c:61: error: for each function it appears in.) rlm_raw.c:61: error: expected ‘;’ before ‘strvalue’ rlm_raw.c:62: error: ‘uint32_t’ undeclared (first use in this function) rlm_raw.c:62: error: expected ‘;’ before ‘lvalue’ rlm_raw.c:63: error: expected ‘;’ before ‘vendorcode’ rlm_raw.c:70: error: ‘PW_TYPE_OCTETS’ undeclared (first use in this function) rlm_raw.c:71: error: ‘ATTR_FLAGS’ undeclared (first use in this function) rlm_raw.c:71: error: expected ‘;’ before ‘flags’ rlm_raw.c:72: error: ‘DICT_ATTR’ undeclared (first use in this function) rlm_raw.c:72: error: ‘da’ undeclared (first use in this function) rlm_raw.c:73: error: ‘DICT_VALUE’ undeclared (first use in this function) rlm_raw.c:73: error: ‘dv’ undeclared (first use in this function) rlm_raw.c:76: error: ‘request’ undeclared (first use in this function) rlm_raw.c:77: error: ‘ptr’ undeclared (first use in this function) rlm_raw.c:77: error: ‘radius_packet_t’ has no member named ‘data’ rlm_raw.c:78: error: ‘subptr’ undeclared (first use in this function) rlm_raw.c:79: error: ‘AUTH_HDR_LEN’ undeclared (first use in this function) rlm_raw.c:82: error: storage size of ‘s_tm’ isn’t known rlm_raw.c:87: warning: implicit declaration of function ‘dict_attrbyname’ rlm_raw.c:87: warning: nested extern declaration of ‘dict_attrbyname’ rlm_raw.c:89: warning: implicit declaration of function ‘strNcpy’ rlm_raw.c:89: warning: nested extern declaration of ‘strNcpy’ rlm_raw.c:92: error: ‘flags’ undeclared (first use in this function) rlm_raw.c:96: error: ‘vendorcode’ undeclared (first use in this function) rlm_raw.c:109: error: ‘PW_VENDOR_SPECIFIC’ undeclared (first use in this function) rlm_raw.c:111: warning: implicit declaration of function ‘memcpy’ rlm_raw.c:111: warning: incompatible implicit declaration of built-in function ‘memcpy’ rlm_raw.c:111: error: ‘lvalue’ undeclared (first use in this function) rlm_raw.c:112: warning: implicit declaration of function ‘ntohl’ rlm_raw.c:112: warning: nested extern declaration of ‘ntohl’ rlm_raw.c:151: error: ‘VENDORPEC_USR’ undeclared (first use in this function) rlm_raw.c:154: warning: implicit declaration of function ‘dict_attrbyvalue’ rlm_raw.c:154: warning: nested extern declaration of ‘dict_attrbyvalue’ rlm_raw.c:180: error: ‘PW_TYPE_STRING’ undeclared (first use in this function) rlm_raw.c:182: warning: implicit declaration of function ‘TAG_VALID_ZERO’ rlm_raw.c:182: warning: nested extern declaration of ‘TAG_VALID_ZERO’ rlm_raw.c:182: error: ‘FLAG_ENCRYPT_TUNNEL_PASSWORD’ undeclared (first use in this function) rlm_raw.c:186: warning: incompatible implicit declaration of built-in function ‘memcpy’ rlm_raw.c:186: error: ‘strvalue’ undeclared (first use in this function) rlm_raw.c:192: error: ‘PW_NAS_PORT’ undeclared (first use in this function) rlm_raw.c:195: warning: implicit declaration of function ‘librad_safeprint’ rlm_raw.c:195: warning: nested extern declaration of ‘librad_safeprint’ rlm_raw.c:205: error: ‘PW_TYPE_INTEGER’ undeclared (first use in this function) rlm_raw.c:206: error: ‘PW_TYPE_DATE’ undeclared (first use in this function) rlm_raw.c:207: error: ‘PW_TYPE_IPADDR’ undeclared (first use in this function) rlm_raw.c:239: warning: implicit declaration of function ‘dict_valbyattr’ rlm_raw.c:239: warning: nested extern declaration of ‘dict_valbyattr’ rlm_raw.c:247: warning: implicit declaration of function ‘strftime’ rlm_raw.c:247: warning: incompatible implicit declaration of built-in function ‘strftime’ rlm_raw.c:247: warning: implicit declaration of function ‘localtime_r’ rlm_raw.c:247: warning: nested extern declaration of ‘localtime_r’ rlm_raw.c:247: warning: passing argument 4 of ‘strftime’ makes pointer from integer without a cast rlm_raw.c:251: warning: implicit declaration of function ‘ip_ntoa’ rlm_raw.c:251: warning: nested extern declaration of ‘ip_ntoa’ rlm_raw.c:251: warning: assignment makes pointer from integer without a cast rlm_raw.c:257: error: ‘PW_TYPE_IFID’ undeclared (first use in this function) rlm_raw.c:262: warning: implicit declaration of function ‘ifid_ntoa’ rlm_raw.c:262: warning: nested extern declaration of ‘ifid_ntoa’ rlm_raw.c:262: warning: assignment makes pointer from integer without a cast rlm_raw.c:268: error: ‘PW_TYPE_IPV6ADDR’ undeclared (first use in this function) rlm_raw.c:273: warning: implicit declaration of function ‘ipv6_ntoa’ rlm_raw.c:273: warning: nested extern declaration of ‘ipv6_ntoa’ rlm_raw.c:273: warning: assignment makes pointer from integer without a cast rlm_raw.c:277: warning: implicit declaration of function ‘DEBUG’ rlm_raw.c:277: warning: nested extern declaration of ‘DEBUG’ rlm_raw.c:282: warning: implicit declaration of function ‘strcpy’ rlm_raw.c:282: warning: incompatible implicit declaration of built-in function ‘strcpy’ rlm_raw.c:292: warning: implicit declaration of function ‘DEBUG2’ rlm_raw.c:292: warning: nested extern declaration of ‘DEBUG2’ rlm_raw.c:294: warning: implicit declaration of function ‘strlen’ rlm_raw.c:294: warning: incompatible implicit declaration of built-in function ‘strlen’ rlm_raw.c:82: warning: unused variable ‘s_tm’ rlm_raw.c:57: warning: unused parameter ‘instance’ rlm_raw.c: At top level: rlm_raw.c:307: error: expected ‘)’ before ‘*’ token rlm_raw.c: In function ‘raw_detach’: rlm_raw.c:335: warning: implicit declaration of function ‘xlat_unregister’ rlm_raw.c:335: warning: nested extern declaration of ‘xlat_unregister’ rlm_raw.c: At top level: rlm_raw.c:351: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rlm_raw’ make[6]: *** [rlm_raw.lo] Error 1 make[6]: Leaving directory `/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7/src/modules/rlm_raw' make[5]: *** [common] Error 2 make[5]: Leaving directory `/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7/src/modules' make[4]: *** [all] Error 2 make[4]: Leaving directory `/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7/src/modules' make[3]: *** [common] Error 2 make[3]: Leaving directory `/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7/src' make[1]: *** [common] Error 2 make[1]: Leaving directory `/usr/src/freeradius-server-2.1.7-pre/freeradius-server-2.1.7' make: *** [all] Error 2 --------------SNIP------------------------ -- Johan Meiring Cape PC Services CC Tel: (021) 883-8271 Fax: (021) 886-7782
Johan Meiring wrote:
After struggling for about 4 hours, I did the following.... 1) touch src/modules/rlm_raw/configure 2) ./autogen.sh 3) added rlm_raw to debian configure by editing debian/rules
Now it tries to compile it, but fails horribly. (See compile failure below).
Does anyone have a clue how to add rlm_raw to the current git tar file?
$ tar -zxf freeradius-server-2.1.7.tar.gz << add rlm_raw >> $ tar -zcf freeradius-server-2.1.7.tar.gz freeradius-server-2.1.7
PS:he rlm_raw I'm using comes from http://lists.cistron.nl/pipermail/freeradius-devel/2005-January/007873.html
That was before version 2.0 was released. You'll likely have to update the module to use the new API's && header files in 2.0. Alan DeKok.
Alan DeKok wrote:
Does anyone have a clue how to add rlm_raw to the current git tar file?
$ tar -zxf freeradius-server-2.1.7.tar.gz << add rlm_raw >> $ tar -zcf freeradius-server-2.1.7.tar.gz freeradius-server-2.1.7
It wasn't that simple because rlm_raw did not contain a configure script. You had to run autogen.sh first.
PS:he rlm_raw I'm using comes from http://lists.cistron.nl/pipermail/freeradius-devel/2005-January/007873.html
That was before version 2.0 was released. You'll likely have to update the module to use the new API's && header files in 2.0.
Using my "copy and paste" method of c coding (I know VERY little about c) I maneged to copy the code from the old rlm_raw into rlm_example. I needed to make two changes to get it to compile. 1) replace strNcpy with strncpy 2) replace radlib_safeprint with fr_print_string It compiled and IT WORKS!!!
Alan DeKok.
-- Johan Meiring Cape PC Services CC Tel: (021) 883-8271 Fax: (021) 886-7782
participants (4)
-
Ahmed Nifaz Faizabadi -
Alan DeKok -
Ivan Kalik -
Johan Meiring