Bug 163786

Summary: Timestamp of /var/log/rpmpkgs could be useful
Product: [Fedora] Fedora Reporter: Jeff Norden <jeff>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 4Keywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-25 15:30:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
replacement for the /etc/cron.daily/rpm script none

Description Jeff Norden 2005-07-21 01:56:01 UTC
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:
Always

Steps to Reproduce:
1.Don't install or uninstall any packages for several weeks
2.
3.
  

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-21 02:03:24 UTC
Created attachment 117001 [details]
replacement for the /etc/cron.daily/rpm  script

Comment 2 Jeff Norden 2005-07-21 14:21:42 UTC
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 15:30:23 UTC
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.