syslogd is set up to send mail log messages to /var/log/mail, however logrotate is not set up to rotate this file. While the default system does not send mail messages, there are addons (such as WIO) that do. This can lead to this file growing without restriction. This file should either be rotated or merged back into the default log. For information my log file is over 550KB.
Matthias, could you have a look at this?
What about this in '/etc/logrotate.conf'? /var/log/mail.log { weekly rotate 4 copytruncate compress notifempty missingok }
That should do it. Did you test it?
Yes. I'm testing and waiting for the next rotation.
/var/log/mail is an output from syslogd, so wouldn't it be preferable to add the file to the existing list of syslogd output files rather than creating it's own entry? That would save any problems due to lack of synchronisation with syslogd being sent the HUP signal. I'm not sure whether there would be any problems in practice, but it's possible that mail log messages could go missing if they're written after the mail log is rotated but before syslogd receives it's HUP - they could still be written to the old mail log file which will syslogd will still have open. They will then be deleted when sylogd receives the HUP. (Note: in case it's not clear, the 550KB in my original report refers to the size of my mail log file).
I tested: /var/log/mail { weekly rotate 4 copytruncate compress notifempty missingok } Worked. But I'm not using 'Mail Service', so there are not much entries and nearly nothing to rotate. @Tim (your case is clear): If I get you right, the alternative would be to add '/var/log/mail' like this: /var/log/messages /var/log/bootlog /var/log/dhcpcd.log /var/log/mail { create 664 root syslogd sharedscripts ifempty postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true endscript } Done. Testing... ;-) Any opinions?
I guess Tim’s suggestion would work...
Matthias, That alternative is what I was thinking of. It would be my preference.
Done. => https://git.ipfire.org/?p=people/mfischer/ipfire-2.x.git;a=commit;h=74726d64366290191f66a4d4f4e20886b87be151 => https://patchwork.ipfire.org/patch/2417/
https://blog.ipfire.org/post/ipfire-2-23-core-update-136-released