Bug 709034 - Logrotate fails to create new logfiles
Summary: Logrotate fails to create new logfiles
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: logrotate
Version: 15
Hardware: i386
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jan Kaluža
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-30 12:56 UTC by Jason Burgess
Modified: 2011-06-04 02:58 UTC (History)
3 users (show)

Fixed In Version: logrotate-3.7.9-11.fc15
Clone Of:
Environment:
Last Closed: 2011-06-04 02:58:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Logs and all logrotate configs. (7.29 KB, application/x-zip-compressed)
2011-05-30 12:56 UTC, Jason Burgess
no flags Details

Description Jason Burgess 2011-05-30 12:56:28 UTC
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:

Comment 1 Jan Kaluža 2011-05-30 14:37:34 UTC
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...

Comment 2 Jason Burgess 2011-05-30 14:48:35 UTC
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.

Comment 3 Jan Kaluža 2011-05-30 15:03:42 UTC
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...)

Comment 4 Jason Burgess 2011-05-30 16:41:27 UTC
[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)

Comment 5 Jason Burgess 2011-05-30 16:41:56 UTC
Oh and no ACLs on my system that I am aware of. :)

Comment 6 Fedora Update System 2011-05-31 09:29:31 UTC
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

Comment 7 Jason Burgess 2011-05-31 12:55:43 UTC
Tested new build and working properly now on machine in question. Many thanks! :)

Comment 8 Jan Kaluža 2011-05-31 13:04:26 UTC
Glad to hear it, thanks.

Comment 9 Fedora Update System 2011-06-02 18:56:27 UTC
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).

Comment 10 Fedora Update System 2011-06-04 02:58:25 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.