Discussion:
rpm --verify, timestamp differences
Robin Bowes
2008-06-14 00:54:45 UTC
Permalink
Hi,

Can anyone tell me why, on a newly-installed (from kickstart) minimal
CentOS system, some of the packages fail verification because of
timestamp differences on some files?

For example:
# rpm --verify device-mapper
.......T /usr/include/libdevmapper-event.h
.......T /usr/include/libdevmapper.h
.......T d /usr/share/man/man8/dmsetup.8.gz

Now, it would be possibly understandable if the files that were changed
were config files, but those listed above are a couple of headers and a
man page.

Why would the timestamps be different than the metadata in the RPM database?

R.
Jeff Johnson
2008-06-14 16:34:44 UTC
Permalink
Post by Robin Bowes
Hi,
Can anyone tell me why, on a newly-installed (from kickstart)
minimal CentOS system, some of the packages fail verification
because of timestamp differences on some files?
# rpm --verify device-mapper
.......T /usr/include/libdevmapper-event.h
.......T /usr/include/libdevmapper.h
.......T d /usr/share/man/man8/dmsetup.8.gz
Now, it would be possibly understandable if the files that were
changed were config files, but those listed above are a couple of
headers and a man page.
Why would the timestamps be different than the metadata in the RPM database?
The issue is peculier to kickstart & anaconda, not rpm. I have
personally
seen the rpm --verify complaints, but only immediately after kickstart/
anaconda
installs/upgrades.

Meanwhile, its easier to just fix the mtimes than to try to understand
Why ... ?

Here's a means to reestablish file mtimes whenever necessary using --
setmtimes
popt alias wrapper to the necessary touch(1) command.

Disclaimer: I haven't tested this --setmtimes alias for over a year,
its just some
litter that I happen to have lying around.

Add this popt alias for --setmtimes to /etc/popt:

rpm alias --setmtimes -q --qf '[\[ -L %{FILENAMES:shescape} \] ||
touch -m -c --date="%{FILEMTIMES:date}" %{FILENAMES:shescape}\n]' \
--pipe "sh"
--POPTdesc=$"set mtime of file(s) in a package"

Choose some package "foo" to test.

Type
rpm --setmtimes foo
to verify functionality. Lather rinse repeat until you are confident
that --setmtimes does what its supposed to do.

(aside) I considered carrying --setmtimes as Yet Another option in
rpm, but
the pain of adding --setmtimes to rpm does not justify the gain of
repairing (and concealing) kickstart/anaconda flaws imho.

YMMV, everyone's does.

hth

73 de Jeff
Robin Bowes
2008-06-14 20:05:32 UTC
Permalink
Post by Robin Bowes
Hi,
Can anyone tell me why, on a newly-installed (from kickstart) minimal
CentOS system, some of the packages fail verification because of
timestamp differences on some files?
# rpm --verify device-mapper
.......T /usr/include/libdevmapper-event.h
.......T /usr/include/libdevmapper.h
.......T d /usr/share/man/man8/dmsetup.8.gz
Now, it would be possibly understandable if the files that were
changed were config files, but those listed above are a couple of
headers and a man page.
Why would the timestamps be different than the metadata in the RPM database?
The issue is peculier to kickstart & anaconda, not rpm. I have personally
seen the rpm --verify complaints, but only immediately after
kickstart/anaconda
installs/upgrades.
Meanwhile, its easier to just fix the mtimes than to try to understand
Why ... ?
Here's a means to reestablish file mtimes whenever necessary using
--setmtimes
popt alias wrapper to the necessary touch(1) command.
Disclaimer: I haven't tested this --setmtimes alias for over a year, its
just some
litter that I happen to have lying around.
rpm alias --setmtimes -q --qf '[\[ -L %{FILENAMES:shescape} \] ||
touch -m -c --date="%{FILEMTIMES:date}" %{FILENAMES:shescape}\n]' \
--pipe "sh"
--POPTdesc=$"set mtime of file(s) in a package"
Choose some package "foo" to test.
Type
rpm --setmtimes foo
to verify functionality. Lather rinse repeat until you are confident
that --setmtimes does what its supposed to do.
(aside) I considered carrying --setmtimes as Yet Another option in rpm, but
the pain of adding --setmtimes to rpm does not justify the gain of
repairing (and concealing) kickstart/anaconda flaws imho.
YMMV, everyone's does.
hth
Jeff,

Thanks - I'll give that a shot.

R.
Robin Bowes
2008-06-16 16:52:20 UTC
Permalink
Post by Robin Bowes
Jeff,
Thanks - I'll give that a shot.
OK, so I the popt macro.

Mixed results - some packages worked OK, others didn't. Example:

# rpm --verify device-mapper
.......T /sbin/dmeventd
.......T /sbin/dmsetup
.......T /sbin/dmsetup.static
.......T /usr/include/libdevmapper-event.h
.......T /usr/include/libdevmapper.h
.......T d /usr/share/man/man8/dmsetup.8.gz

# rpm --setmtimes device-mapper

# rpm --verify device-mapper
.......T /sbin/dmeventd
.......T /sbin/dmsetup
.......T /sbin/dmsetup.static
.......T /usr/include/libdevmapper-event.h
.......T /usr/include/libdevmapper.h
.......T d /usr/share/man/man8/dmsetup.8.gz


Also, there problems other than mtime, e.g:

# rpm --verify setup
S.5..... c /etc/securetty



Any ideas what's still wrong?

R.

Loading...