Summary: | app-admin/logrotate - deletes data in a corner case | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Toralf Förster <toralf> |
Component: | [OLD] Server | Assignee: | Chema Alonso Josa (RETIRED) <nimiux> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | jer |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Toralf Förster
2013-04-15 18:44:41 UTC
The last rotation on /var/log/messages was apparently done on April 14, so it isn't done again on the 15th, probably because you have "weekly" in /etc/logrotate.conf. It shouldn't clear out the file, though. Can you post the changes between both /var/log/messages files (redacted if needed)? (In reply to comment #1) > The last rotation on /var/log/messages was apparently done on April 14, so > it isn't done again on the 15th, probably because you have "weekly" in > /etc/logrotate.conf. yeah - looks like a logic flow in logrotate, I do currently have (Gentoo default): $ cat /etc/logrotate.d/syslog-ng # $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v 1.3 2008/10/15 20:46:12 mr_bones_ Exp $ # # Syslog-ng logrotate snippet for Gentoo Linux # contributed by Michael Sterrett # /var/log/messages { missingok sharedscripts postrotate /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true endscript } >It shouldn't clear out the file, though. yes >Can you post the changes between both /var/log/messages files (redacted if needed)? no - the old messages are just away :-( this doesn't have anything to do with syslog-ng as far as I can tell. (In reply to comment #3) > this doesn't have anything to do with syslog-ng as far as I can tell. correct re-assigning to app-admin/logrotate I think this is what's happening: You are running logrotate with syslog-ng as its config file (not logrotate.conf), so no 'dateext' option is set (previous rotations took place with this option set), so there is no way for logrotate to identify previous rotations. According to the following snippet, no old logs are kept when forced from the command line, so your /var/log/messages file gets renamed and deleted, because its the disposed name in the rotation: <snip> # /usr/sbin/logrotate -fv /etc/logrotate.d/syslog-ng reading config file /etc/logrotate.d/syslog-ng Handling 1 logs rotating pattern: /var/log/messages forced from command line (no old logs will be kept) empty log files are rotated, old logs are removed considering log /var/log/messages log needs rotating rotating log /var/log/messages, log->rotateCount is 0 dateext suffix '-20130418' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' renaming /var/log/messages.1 to /var/log/messages.2 (rotatecount 1, logstart 1, i 1), old log /var/log/messages.1 does not exist renaming /var/log/messages.0 to /var/log/messages.1 (rotatecount 1, logstart 1, i 0), old log /var/log/messages.0 does not exist log /var/log/messages.2 doesn't exist -- won't try to dispose of it renaming /var/log/messages to /var/log/messages.1 disposeName will be /var/log/messages.1 running postrotate script removing old log /var/log/messages.1 </snip> I don't think we should consider this a bug, because the proper way to run logrotate in this case is: /usr/sbin/logrotate -f /etc/logrotate.conf (In reply to comment #5) > I don't think we should consider this a bug, because the proper way to run > logrotate in this case is: > > /usr/sbin/logrotate -f /etc/logrotate.conf Hhm - ok. (But me is just wondering how to properly run logrotate for one specific log file) (In reply to comment #6) > (But me is just wondering how to properly run logrotate for one specific log > file) Well, I think that depends a lot on your setup. You can change the line: include /etc/logrotate.d to: include /etc/logrotate.d/syslog-ng in the /etc/logrotate.conf config file This way only the syslog-ng config is sourced. ok - thx So this bug report is marked by me as invalid. |