Summary: | Mail log file is not rotated | ||
---|---|---|---|
Product: | IPFire | Reporter: | Tim <ipfb> |
Component: | --- | Assignee: | Matthias Fischer <matthias.fischer> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | Minor Usability | ||
Priority: | Will only affect a few users | CC: | michael.tremer, peter.mueller |
Version: | 2 | ||
Hardware: | all | ||
OS: | All |
Description
Tim
2019-09-03 17:10:29 UTC
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/ |