Bug 163786 - Timestamp of /var/log/rpmpkgs could be useful
Timestamp of /var/log/rpmpkgs could be useful
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2005-07-20 21:56 EDT by Jeff Norden
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-08-25 11:30:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
replacement for the /etc/cron.daily/rpm script (216 bytes, text/plain)
2005-07-20 22:03 EDT, Jeff Norden
no flags Details

  None (edit)
Description Jeff Norden 2005-07-20 21:56:01 EDT
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):

How reproducible:

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.

Additional info:
Comment 1 Jeff Norden 2005-07-20 22:03:24 EDT
Created attachment 117001 [details]
replacement for the /etc/cron.daily/rpm  script
Comment 2 Jeff Norden 2005-07-21 10:21:42 EDT
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
little  later.

Sorry for the confusion.
Comment 3 Jeff Johnson 2005-08-25 11:30:23 EDT
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.

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