Hello everyone, As you know, FR has a radius.log file under /var/log/radius directory. I noticed that inside the logrorate file, radius.log is set to rotate every month. Like this : /var/log/radius/radius.log { monthly rotate 100 create missingok compress } This is by default. I changed this to "daily" but the problem is, I need to restart radius everytime when the new day comes in order to write to NEW radius.log file. If I do not restart, it tries to point the compress version of the old radius.log. Why is that? I also can not do this inside an external script. When I rename the file inside the script, it still writes to the new renamed radius.log file. Any suggestions or any place for me to read? Thanks You in advance. -- View this message in context: http://freeradius.1045715.n5.nabble.com/Logrotate-tool-tp5709081.html Sent from the FreeRadius - User mailing list archive at Nabble.com.
On Mon, May 14, 2012 at 9:15 PM, yagizozen <yagizozen@yahoo.com> wrote:
Hello everyone,
As you know, FR has a radius.log file under /var/log/radius directory. I noticed that inside the logrorate file, radius.log is set to rotate every month. Like this :
/var/log/radius/radius.log { monthly rotate 100 create missingok compress }
This is by default. I changed this to "daily" but the problem is, I need to restart radius everytime when the new day comes in order to write to NEW radius.log file. If I do not restart, it tries to point the compress version of the old radius.log.
Why is that?
It's a bug in the distro you're using. FR's logging behavior changed (in 2.1.9, I think), but the logrotate script was not updated (yet) to follow that behavior.
I also can not do this inside an external script. When I rename the file inside the script, it still writes to the new renamed radius.log file. Any suggestions or any place for me to read?
This is what debian/ubuntu uses: $ cat freeradius.logrotate /var/log/freeradius/*.log { weekly rotate 52 compress delaycompress notifempty missingok postrotate /etc/init.d/freeradius reload > /dev/null endscript } Slightly different from the default setup or other distros (radiusd -> freeradius), but you get the idea :) -- Fajar
Hi, you could also try to use copytruncate This will not remove the current log file, but will copy the logfile and then try to truncate, so that you should not run into file handle issues. Kind regards Cornelius Am 14.05.2012 16:15, schrieb yagizozen:
Hello everyone,
As you know, FR has a radius.log file under /var/log/radius directory. I noticed that inside the logrorate file, radius.log is set to rotate every month. Like this :
/var/log/radius/radius.log { monthly rotate 100 create missingok compress }
This is by default. I changed this to "daily" but the problem is, I need to restart radius everytime when the new day comes in order to write to NEW radius.log file. If I do not restart, it tries to point the compress version of the old radius.log.
Why is that?
I also can not do this inside an external script. When I rename the file inside the script, it still writes to the new renamed radius.log file. Any suggestions or any place for me to read?
Thanks You in advance.
-- View this message in context: http://freeradius.1045715.n5.nabble.com/Logrotate-tool-tp5709081.html Sent from the FreeRadius - User mailing list archive at Nabble.com. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hello Guys, Thank you for your replies, I decided to use as u said copytruncate and it works well for me. It says that there can be some data loses between the copy and truncate proccesses but it will not be a problem for me. Thank you very much -- View this message in context: http://freeradius.1045715.n5.nabble.com/Logrotate-tool-tp5709081p5709822.htm... Sent from the FreeRadius - User mailing list archive at Nabble.com.
participants (3)
-
Cornelius Kölbel -
Fajar A. Nugraha -
yagizozen