| Summary: | Logrotate fails to create new logfiles | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Jason Burgess <jason.donald.burgess> | ||||
| Component: | logrotate | Assignee: | Jan Kaluža <jkaluza> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 15 | CC: | gregorio.gervasio, jkaluza, tsmetana | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | i386 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | logrotate-3.7.9-11.fc15 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2011-06-04 02:58:35 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
I'm sorry, but I'm not able to reproduce it on F15 so far. Could you please try to run "logrotate -vf /etc/logrotate.d/snmpd.conf" (replace snmpd.conf with any config which fails) and paste whole logrotate output here and also the config file? From source code I don't see how this is possible so far... From logrotate output:
[11:46 AM] root@jacknife2:~# logrotate -vf /etc/logrotate.d/snmpd
reading config file /etc/logrotate.d/snmpd
Handling 1 logs
rotating pattern: /var/log/snmpd.log forced from command line (no old logs will be kept)
empty log files are rotated, old logs are removed
considering log /var/log/snmpd.log
log needs rotating
rotating log /var/log/snmpd.log, log->rotateCount is 0
dateext suffix '-20110530'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/snmpd.log.1 to /var/log/snmpd.log.2 (rotatecount 1, logstart 1, i 1),
old log /var/log/snmpd.log.1 does not exist
renaming /var/log/snmpd.log.0 to /var/log/snmpd.log.1 (rotatecount 1, logstart 1, i 0),
old log /var/log/snmpd.log.0 does not exist
log /var/log/snmpd.log.2 doesn't exist -- won't try to dispose of it
renaming /var/log/snmpd.log to /var/log/snmpd.log.1
disposeName will be /var/log/snmpd.log.1
creating new /var/log/snmpd.log mode = 0644 uid = 0 gid = 0
error: getting file ACL /var/log/snmpd.log: No such file or directory
From /etc/logrotate.d/snmpd:
[11:46 AM] root@jacknife2:~# cat /etc/logrotate.d/snmpd
/var/log/snmpd.log {
missingok
create 0644 root root
postrotate
/sbin/service snmpd restart 2> /dev/null > /dev/null || true
endscript
}
===================
It appears due to the ACL error, the logrotate stops at the rename point and the service never gets restarted to create the new log file and nothing gets compressed.
Thanks, I think I know what's wrong. What filesystem do you use on /var/log and do you have ACLs enabled there? I think you don't have it enabled and logrotate fails because of that (which is bug of course, but I just want to be sure what's the real reason...) [01:40 PM] root@jacknife2:~# cd /var/log [01:40 PM] root@jacknife2:/var/log# df -k . Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 41341740 8668908 30572740 23% / [01:40 PM] root@jacknife2:/var/log# mount | grep /dev/sda1 /dev/sda1 on / type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered) Oh and no ACLs on my system that I am aware of. :) logrotate-3.7.9-11.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/logrotate-3.7.9-11.fc15 Tested new build and working properly now on machine in question. Many thanks! :) Glad to hear it, thanks. Package logrotate-3.7.9-11.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing logrotate-3.7.9-11.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/logrotate-3.7.9-11.fc15 then log in and leave karma (feedback). logrotate-3.7.9-11.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report. |
Created attachment 501797 [details] Logs and all logrotate configs. Description of problem: During rotation of the log files since upgrading to F15, the following error occurs on all logs when performing a rotation: [snippet] old log /var/log/snmpd.log.0.gz does not exist log /var/log/snmpd.log.13.gz doesn't exist -- won't try to dispose of it renaming /var/log/snmpd.log to /var/log/snmpd.log.1 creating new /var/log/snmpd.log mode = 0644 uid = 0 gid = 0 error: getting file ACL /var/log/snmpd.log: No such file or directory This results in a "filename.1" file left, handles open and continuing to be written to by the various programs, and never a restart command is given to the service in question. The log rotation process STOPS at this point for each log. Version-Release number of selected component (if applicable): FC15 32-bit, logrotate-3.7.9-8.fc15.i686 How reproducible: Easy. Simply force a log rotation with "logrotate -vf /etc/logrotate.conf" Full log attached. Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: