- run "rpm -V" on all the packages and look out for packages where files are (a) missing or (b) corrupted; the script as a bonus (c) can even print out config files that have been modified (which likely should be part of a separate script, as that might be handy for backup purposes); if likely (d) should offer to reinstall packages that have missing or corrupted files
- run something like "find /bin/ /boot/ /etc/ /lib/ /opt/ /sbin/ /usr/ /var/" with "-type f" and/or "-type d" and let rpm check if the list of files and/or directories that find outputs are owned by a package -- complain if not; that's quite a lot of work for the system and takes a while to complete, but often turns up a whole lot of old and obsolete cruft that is lying in some hidden corner of the hard disk just waiting to get erased (just checked a random machine; 3241 files sum up to 380 MByte...)
- run something like "find /boot/ /etc/ /opt/ /usr/ /var/" with "-name '*.rpmnew'" "-name '*.rpmsave'"; go through the list of files find outputs, show a "diff -u" and offer the user to either
- run tools like meld or kdiff3 to merge the files(¹) and remove the .rpm{new,save}-file afterwards
- replace the file with its .rpm{new,save}-pendant (or do it semi-automatically if sha1sums are identical)
- delete the .rpm{new,save}-file
- do nothing
- run tools like meld or kdiff3 to merge the files(¹) and remove the .rpm{new,save}-file afterwards
- a script that calls all the above tests as well as "package-cleanup" sequentially with the options "--problems", "--orphans", and "--dupes" to generate a report of "unusual" things
Dear reader: Would you find such a package useful? Or are there already such scripts/tools somewhere in the big Fedora package collection and I'm just not aware of them?
(¹) that works quite well for a lot of config files, but breaks horrible for those that have lots of comments in them that try to explain each and every option and/or variable :-(( it get even worse if those comments change every few months.
So this goes to the authors of dovecot, postfix, squid, and other software that has lots of comments in their default config files: "Config files are for configuration and should not contain lots of comments that get adjusted every few months, as those make it really hard to merge older (modified) config files with new one; in the future please consider to explain all option in a proper document like a man-page instead please and remove the comments from the config files! Thanks in advance! Yours truly, Thorsten Leemhuis"
4 Kommentare:
I love the idea! Tools like that to me seems like valuable tools. I would like a little more information regardign specifics such as how does the script merge files what does it do when it finds conflicts and so on.
+1 from me though
Yes please! I do have some similar scripts. I've also found myself using rpm QUERYFORMAT options (unversioned, including arch, buildhost, etc.) a lot to compare two systems. It's not difficult but somewhat tedious.
Just one question:
WHERE?
You can use yum's verify() method from any installed package object to generate a set of pkgs with files. It makes it easier to generate reports b/c you don't have to use grep + sed + awk to screen scrape the rpm -V output.
Kommentar veröffentlichen