Logrotate weird behavior
I'm running FC 10 and have rsyslog receiving logs from an external server successfully.
I added a config in the /etc/logrotate.conf to rotate those logs daily and create a new log: Code:
/var/log/mylog/*.log { |
I thinke the problem is that when logrotate rotate the file, it creates a new file and simply renames the old one. The old file, thus with the old inode, will still be written to as long as the application doesn't reopen the file. So in other words, as long as the application isn't told otherwise, it will continue to write to the same inode forever.
You can do one of two things: 1) Make sure the application closes and opens connection to the file (this is what the "kill -HUP" signal often is used for), or 2) use the notruncate option (or whatever it it called again) in logrotate. EDIT: "copytruncate" is the option looking for. Regards, kenneho |
thanks kenneho - that is something I was looking at.
However, what PID would I kill to effectively restart the service - rsyslog? The external logs are configured thru the rsyslog.conf file. Should I kill the rsyslog PID? This is what I see for processes... Code:
#ps -aux | grep rsyslog |
Quote:
|
I'm giving this a shot in my logrotate.conf file - we'll see. Thanks again!
Code:
/var/log/info/*.log { |
Quote:
|
All times are GMT -5. The time now is 04:41 PM. |