Updating Configuration Files

I previously used a gentoo-based system for daily use before taking the plunge moving over to FreeBSD. When updating software on a gentoo box, a step in the process looks for changes to configuration files (usually in /etc) and advises user of need for action. User then invokes an executable to diff/merge changes. It is a very straight forward and quickly understood command-line maintenance process.

I had understood from other readings the steps necessary to keep kernel/ports/packages up to date. However, a recent pkg update triggered a message highlighted missing knowledge. How to update a configuration file?

My previous posts have impressed on me the need to RTFM. However, I have not been able to locate a mechanism or process for updating configuration files.

A web search brought me to a recent forum post, Thread 89974, which talked about processes related to freebsd-update. There was a mention of an OpenBSD tool for configuration file updating.

As part of web search I stumbled on the man page for etcupdate(8). However, if one does not install a src tree then the underlining database cannot be bootstrap'd.

Is there a tool that a user can employ to aid in configuration file updates?

If a tool doesn't exist, has consideration been given to developing, or importing from elsewhere, such a tool?
 
See the handbook: https://docs.freebsd.org/en/books/handbook/book/#freebsdupdate-upgrade
Once all the patches have been downloaded to the local system, they will be applied. This process may take a while, depending on the speed and workload of the machine. Configuration files will then be merged. The merging process requires some user intervention as a file may be merged or an editor may appear on screen for a manual merge. The results of every successful merge will be shown to the user as the process continues. A failed or ignored merge will cause the process to abort. Users may wish to make a backup of /etc and manually merge important files, such as master.passwd or group at a later time.

So, merging configuration files is part of freebsd-update(8). etcupdate(8) just exists to provide similar functionality for upgrading from source.
 
zirias@ - I got that from the referenced forum Thread 89974.

However,...

If one does a pkg upgrade and package update results in a changed configration file - there is no automagical mechanism for configuration updating.

...which bring us back to the original post.
 
zirias@ - I got that from the referenced forum Thread 89974.

However,...

If one does a pkg upgrade and package update results in a changed configration file - there is no automagical mechanism for configuration updating.

...which bring us back to the original post.
Packages won't change any system configuration file. I mean in /etc.
 
One pattern that I have noticed with packages is they rarely install a configuration file; rather they install "sample configuration files" like /usr/local/etc/ntpd.conf.sample. You then use the sample and create from scratch or copy the sample and edit.
 
I previously used a gentoo-based system for daily use before taking the plunge moving over to FreeBSD. When updating software on a gentoo box, a step in the process looks for changes to configuration files (usually in /etc) and advises user of need for action. User then invokes an executable to diff/merge changes. It is a very straight forward and quickly understood command-line maintenance process.
The difference between FreeBSD and Linux is that FreeBSD has a strict difference between OS configuration files which generally go in /etc, sometimes in /boot and pkg configuration files which go in /usr/local/etc. Linux has no such delineation.
 
debian packaging you mark things as "config files" (directories, full path for files), there are default values and the packaging tools (typically apt on Debian based systems) keep track of them so on an upgrade it can prompt to keep/replace/merge.
Could the current FreeBSD tools be modified to provide similar? Probably. But each package would have more metadata, a copy of the original from the package or at least hash needs to be kept around so the tool can prompt or the package itself could provide the functionality of compare and merge.
Not sure what a good path would be, keeping in mind any kind of transition period where the local package database doesn't have the information, the tool knows how to do it, the new package has the info.
 
I have yet to have any problems with config files in /usr/local/etc. The files in /etc is updated with etcupdate (as you could in gentoo as far I remember) every time I make a new build of Freebsd-Stable
 
Seems I'm getting a "can't happen" or "doesn't happen" feedback.

Situation where I encountered this was with security/sudo.
The following occurred:
Code:
# pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (12 candidates): 100%
Processing candidates (12 candidates): 100%
The following 5 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
...
    sudo: 1.9.15p2 -> 1.9.15p4
...
[2/5] Fetching sudo-1.9.15p4.pkg: 100%    2 MiB   1.8MB/s    00:01   
...
Checking integrity... done (0 conflicting)
...
[2/5] Upgrading sudo from 1.9.15p2 to 1.9.15p4...
[2/5] Extracting sudo-1.9.15p4: 100%
...
==> Running trigger: desktop-file-utils.ucl
Building cache database of MIME types
You may need to manually remove /usr/local/etc/sudoers if it is no longer needed.

As the sudo package was deinstalled/re-installed, it appears a warning was issued for the sudoers file being resident/residual.
 
Seems I'm getting a "can't happen" or "doesn't happen" feedback.

As the sudo package was deinstalled/re-installed, it appears a warning was issued for the sudoers[ICODE] file being resident/residual.

It's a warning, not a problem. And specifically, I think it's triggered by the deinstallation process before reinstallation. So to speak, an artefact. You see? "You MAY need...". As sudo is yet installed, you need /usr/local/etc/sudoers.

Look well, it's about /usr/local/etc not /etc. And this is a huge difference for the overall system stability, no matters what a package can do in /usr/local/etc, the OS stays stable.
 
When updating software on a gentoo box, a step in the process looks for changes to configuration files (usually in /etc) and advises user of need for action. User then invokes an executable to diff/merge changes.
FreeBSD doesn't change config files when updating with pkg. When doing major updates as from 13.2 to 14, you are interupted to accept some changes in /etc/passwd and another I forgot. Changes are marked. You just have to know how to use vi or editors/vim (and how to exit it ;-).

User config files in your home directory are not changed.

I developed the habit of backing up some global config files in a directory on my home-dir. That way, I always have a system-wide backup. It is only needed at a fresh install.

/boot/loader.conf
/root/.cshrc.conf
/etc/devfs.rules
/etc/devfs.conf
/etc/hosts
/ect/rc.conf
/etc/sysctl.conf
/etc/wpa_supplicant.conf

There might be other files to backup, but these are the ones I save.

Saving the output of pkg prime-list might come handy for re-installing everything you had aboard.
 
Back
Top