Red Hat Bugzilla – Bug 163786
Timestamp of /var/log/rpmpkgs could be useful
Last modified: 2007-11-30 17:11:10 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Description of problem:
It would be nice if the timestamp of /var/log/rpmpkgs showed the last time that packages were installed or uninstalled. As it is, the file is overwritten each day regardless. Similarly, the rotated files rpmpkgs.1, etc should contain previous configurations, not just the ones from last week. As it is, if no packages are changed for several weeks, all the rotated files will be identical.
This is very easily achived by replacing the current /etc/cron.daily/rpm script with one that is only slightly more complex. I'll attach one shortly.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Don't install or uninstall any packages for several weeks
Actual Results: The file /var/log/rpmpkgs is overwritten each night. The log file is rotated each week, and the rotated versions are identical to the current one.
Expected Results: Better behavior, imho, would be for the rpmpkgs log file to have a modification date showing the day that rpms were last changed. The rotated files should have the most recent distinct lists.
Created attachment 117001 [details]
replacement for the /etc/cron.daily/rpm script
Well... drat. Logrotate doesn't work the way I was thinking, so my first
attachment won't work as advertised. The weekly rotation will create an empty
/var/log/rpmpkgs, which will cause a new list of rpm's to then be generated.
Adding the "copy" option to /etc/logrotated.d/rpm would preserve the log file's
timestamp, but still won't prevent weekly rotation of identical files. logrotate
never looks at the modification times of the log files, just the "last rotation
date" that it has stored.
I guess a fix would be to do the rotation in the cron.daily/rpm script and to
delete the logrotate.d/rpm file altogether. I'll post a candidate scirpt a
Sorry for the confusion.
What purpose is served by copying a time stamp to another file? That is way too subtle and fragile imho,
better imho is to just log the last installed time somewhere.