# [FAQF] GF2: xx config files need updating

## pjp

This is the feedback thread for GF2: xx config files need updating.

Instructions are still needed on how to use etc-update.

----------

## Noltha

Hi!

I think I can help about:

 *FAQs wrote:*   

> Method using "etc-update": 
> 
> Instructions needed.

 

I´m just using this metod:

1st I "unprotect" the /etc folder with:

CONFIG_PROTECT_MASK="/etc" or

CONFIG_PROTECT="-*"

2nd I just run etc-update, and the config files be updated. (use "diff" before run "etc-update" its a great idea)

Byez, sorry about my english  :Smile: 

----------

## papabean

The above method would work if you've never modified any of your config files by hand.  The real power of "etc-update" is more evident when it's used to merge the differences between the new config and the old config.

Method using "etc-update":

When confronted with the following:  *Quote:*   

>  * GNU info directory index is up-to-date.
> 
>  * IMPORTANT: 10 config files in /etc need updating.
> 
>  * Type emerge --help config to learn how to update config files.

 

Type: 

```
etc-update
```

"etc-update" will perform the necessary find command and return a list similar to:

 *Quote:*   

> Scanning Configuration files...
> 
> Automerging trivial changes in: sample-tls.cf
> 
> Automerging trivial changes in: transport
> ...

 

Selecting any of these files from the list produces the following:

 *Quote:*   

> Showing differences between /etc/postfix/main.cf and /etc/postfix/._cfg0000_main.cf
> 
> --- /etc/postfix/main.cf        2003-06-21 02:27:20.000000000 -0700
> 
> +++ /etc/postfix/._cfg0000_main.cf      2003-06-30 06:47:17.000000000 -0700
> ...

 

the postfix main.cf (#5) configuration file was chosen because it represents a clear case of a file that has been modified by hand and could cause the mail server to cease functioning if the configuration were blindly overwritten.

This is the same output provided by the "diff" command, but there are several options available. 

They can be broken down as follows:

1.  If the update seems trivial enough, go ahead and overwrite the original.

2.  If the update seems unnecessary, keep the original.

3.  View the changes and choose which changes to keep  This is the option which offers the best flexibility.

4.  Redisplay the differences between the two files.

The interactive option (#3) displays the differences one at a time, offering a choice of which change to keep.

Here's the option in action:

 *Quote:*   

> /etc/postfix/._cfg0000_main.cf /etc/postfix/main.cf /etc/postfix/main.cf.merged
> 
> Merging /etc/postfix/._cfg0000_main.cf and /etc/postfix/main.cf
> 
> unknown_local_recipient_reject_code = 550                     | #unknown_local_recipient_reject_code = 550
> ...

 

The file displayed on the left is the original and the new configuration is on the right.  In this particular case, the change made to the configuration needs to stay the same.  Pressing "l" will retain that modification.

 *Quote:*   

> %l
> 
> #home_mailbox = .maildir/                                     | home_mailbox = .maildir/
> 
>                                                               > home_mailbox = .maildir/

 

Again, this is a change that should not be made, typing "l" will keep this intact.

 *Quote:*   

> %l
> 
> readme_directory = /usr/share/doc/postfix-2.0.12-r1           | readme_directory = /usr/share/doc/postfix-2.0.13

 

Here's an example of the new configuration having more pertinent information.  Since postfix's readmes are now located in a different directory, the configuration needs to reflect that.  Pressing "r" selects the change from the updated configuration.

 *Quote:*   

> %r
> 
> 1) Replace /etc/postfix/main.cf with merged file
> 
> 2) Show differences between merged file and original
> ...

 

At this point, a temporary file has been created that is a merged file containing the original with the updates that have been chosen prior.

These four options do the following:

1.  Overwrite the original with the new merged file.  This file is a result of the choices made in the above step.

2.  Display the differences between the new merged file and the original configuration.

3.  Start the interactive merging process over.

4.  Make no changes and return to the list of files needing updating.

Selecting option 1 to replace the configuration file, we get:

 *Quote:*   

> Replacing /etc/postfix/main.cf with /etc/postfix/main.cf.merged
> 
> mv: overwrite `/etc/postfix/main.cf'?
> 
> rm: remove regular file `/etc/postfix/._cfg0000_main.cf'? 

 

Confirm the replacement of the config with a simple "y".  Likewise, allow the ._cfg????_* file to be removed so that Portage no longer thinks this file needs updating.

After confirming the replacement, we are returned to (with the already update config file excluded):

 *Quote:*   

> The following is the list of files which need updating, each 
> 
> configuration file is followed by a list of possible replacement files.
> 
> 1) /etc/ffserver.conf
> ...

 

After all of the files have been checked, changed and replaced, "etc-update" ends with:

 *Quote:*   

> Exiting: Nothing left to do; exiting. :)

 

----------

## slartibartfasz

@papbean

u could add the 'er' and 'el' merge options and a link to the graphical etc-update thread, to give your faq the finishing touch  :Smile: 

----------

## infamousmrsatan

another option besides diff and etc-update is cfg-update.

is an etc-update like program with added features to prevent important files from being mangled, works in gui or tty (depending on diff program used: default is xxdiff), and is generally more user friendly than etc-update.

More information on how to obtain and use cfg-update is here:

https://forums.gentoo.org/viewtopic.php?t=86622&highlight=

I tried it and liked it.  Hopefully it will be in portage soon.

----------

## Hauser

If you already know what files you've modified, go through the file list, pick out these files first and upate them as papabean says. After this, you'll be left with those files you've never edited or would never think of touching them whatsoever (you do need to be sure about this!  :Wink: ),  then you may use "-5" which many people call an 'evil' option; but when you're faced with over 100 to-be-updated files, this option can be very handy! (I'd dare this evil!)  :Smile: 

----------

## river14april

I have tried to follow this, but am confused. find identifies only two cfg files, but emerge is complaining about 40 of them.

Also when logging in to a console I am getting a list of missing variable settings that appears between typing the username and entering the password. I haven't figured out a way of capturing them automatically, but the gist of them is that some variable is not set and I must tell "an administrator". Well I told the admin (who is me) and admin didn't know any more than I did  :Wink: 

Should I copy type these messages next time I log in, or have I said enough to identify the issue? Is there a log where such messages might appear (tried dmesg, they are not there, where else might they be?)

I also found a directory possibly missing, /etc/profile.d - this did not cause any error messages, as the script in /etc/profile checks if the files in it are executable, and ignores them if they are not executable/not existing.

I am almost certain I broke something myself (I am a recent returner to Gentoo after years away, last time round we were still doing stage 1-2-3 etc) and have been twiddling too many settings at once, this issue is down to me and not a bug. 

Having got myself here my best thought is too (1) keep the kernel settings from /usr/src/linuxXXX/.config, (2) keep the portage tree, and then (3) install again from scratch. Anyone got any better suggestions?

River~~

----------

