Beginner hint, rpmnew and rpmsave

Tom Mitchell mitch48 at sbcglobal.net
Wed Dec 24 03:14:29 UTC 2003


Since there are numerous beginners on this list here is a hint
that took me a while to discover.

The hint is to resolve the differences hinted at by rpmnew and
rpmsave files.

When a well behaved rpm package installs it knows the difference
between configuration files and other files.  This permits future
update rpm packages to know what to do with the changed and
modified configuration files.

One common strategy for config files involves *rpmnew and
*rpmsave files.  These permit the packager to not clobber changes
you may have made or might need to remember.

For example after updating Apache on one box I see:

 /etc/httpd/conf/httpd.conf.rpmnew

This is the default /etc/httpd/conf/httpd.conf file.  Since your
file could contain important site specific changes, it is not
overwritten.  The 'new' default file from the update package is
installed as rpmnew and might reflect new options or a new notion
of best practices.  The system manager can now compare the new
with the old and make decisions on the various flags and options
(see diff).

Some updates may involve default config file settings that were
unsafe or made obsolete in a major rewrite.  In such cases the
new might be installed and your old file renamed as
something.rpmsave.  Again inspect the differences and resolve the
changes.

So check your upgrade.log and search for *.rpmnew *.rpmsave on
your system.

Check the log:

	egrep "rpmnew|rpmsave" /root/upgrade.log

A quick system wide search trick is to use the slocate data base
that is updated once a day:

	locate rpmnew
	locate rpmsave

Or do full system search with find, something like:

	find / -print | egrep "rpmnew$|rpmsave$"

A cautious system administrator will scan the machine for
*.rpmnew *.rpmsave files after each yum or up2date action. When
done with all the resolutions none will be left in the system.  
Very cautious admins will also have a log file of config files
that have been touched and include them as special in their
backup plans.

There are multiple tools for showing and resolving the
differences between two files.  This week I like the -d option
of vim. I always start in read only mode, example:

   vim -R -d  /etc/httpd/conf/httpd.conf.rpmnew  /etc/httpd/conf/httpd.conf

I still use diff a lot.  Example:

   diff  /etc/httpd/conf/httpd.conf.rpmnew   /etc/httpd/conf/httpd.conf

Some files are configured with an agent/ tool and some are edited
by hand with a text editor.  The "agent/ tool"  generated files
will commonly have a header at the top reminding you what tool
created the file and to not edit by hand.  

If changes are needed to "agent generated files" I make backups
if the tool is new to me, then launch the tool.

So if a package breaks on an update check for rpmnew and rpmsave
files.

Have a Merry Christmas all,
TomM

-- 
	T o m  M i t c h e l l
	mitch48 -a*t- yahoo-dot-com






More information about the users mailing list