Resolve updated configuration files

As packages are upgraded, related configuration files need to be manually merged with the new configuration files as appropriate. Files to search for are *.rpmnew (the new configuration file), *.rpmsave (the original configuration file) and *.rpmorig (the original configuration file, one not owned by a package).

Locate affected configuration files

First, find and display the locations of affected configuration files using the following search:

find / -name "*.rpmnew"
find / -name "*.rpmsave"
find / -name "*.rpmorig"

Example output (note the specific files listed will depend on which configuration files were updated):


It is a good idea to compare the current version of the configuration file with the new version installed by the updated package and merge back changes into the current version of the configuration file. However, the current versions will contain customizations specific to FreePBX DIstro which should be preserved. If uncertain, leave the original configuration lines as is.

Install a file comparison tool

The imediff2 program is helpful in merging old and new config files together. The following commands download this program and place it in /usr/local/bin.

cd /tmp
tar xvfz imediff2_1.1.2.tar.gz
cp -a imediff2/imediff2 /usr/local/bin/

To simply the calling syntax, here is a wrapper script:

vi /usr/local/bin/confmerge
# This is a wrapper script for imediff2 to ease merging old config files into new config files
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
        echo confmerge will merge file1 and file2 and save the results in file1
        echo " Usage: confmerge file1 file2"
        imediff2 -c --output=$1 $1 $2
chmod +x /usr/local/bin/confmerge

Compare old and new configuration files

The following command will use imediff2 compare the existing configuration file /etc/rsyslog.conf with the new file /etc/rsyslog.conf.rpmnew and merge any desired changes back into the current version /etc/rsyslog.

Use the arrow keys to move between changed blocks and use the "a" and "b" keys to select which version to keep. The "a" version is the current (old) version of the file and the "b" version is the new version of the file. Comments are always safe to update to new versions. Other changes are very package-specific and need to be evaluated on a case-by-case basis. As mentioned, keep the original "a" file contents if uncertain which version to keep. Press the "s" key to save the merged file over top of the original configuration file, or press "q" to quit without saving changes.

confmerge /etc/rsyslog.conf /etc/rsyslog.conf.rpmnew

After merging in the new file changes (if any), delete the .rpmnew version of the file to clean up.

rm --force /etc/rsyslog.conf.rpmnew

Any changed configuration files will not take effect until the related program is restarted.

Test reboot

A system reboot at this point is a good idea to ensure that all systems changes take effect and to test that a reboot brings up Asterisk as expected.