[Koha-devel] Automatically managing generated configuration files like log4perl.conf

David Cook dcook at prosentient.com.au
Fri Feb 10 01:51:24 CET 2023


Hey all,

 

Updating configuration files like log4perl.conf can be really painful.
Surely, there has to be a better way? 

 

Jonathan and I talk a bit about this on "Bug 32791 - Log4perl configuration
files need a tool for updating on package upgrade".

 

My first draft uses a bespoke tool, but this morning I learned about the
"ucf" utility, which was designed to manage dynamically generated
configuration in a similar way to how we manage configuration files packaged
in koha-common!

 

If the installed file hasn't been manually updated locally, it will be
replaced with the newest generated version. If the installed file has been
changed, then the user will be prompted with some options about installing
the package version, retaining the local version, viewing a diff of the two
files, or even doing a 3 way merge. 

 

I think 99.9% of cases will show a lot of these files never get locally
changed, so it would just automagically provide updated configuration.

 

And for that 0.1% of cases where the sysadmin has updated the configuration,
they'd have a familiar industry standard UI to work with. 

 

I'm happy to provide a patch, but I'd like to get some more feedback first. 

 

I think it would work very well for log4perl, and it could be useful for
other configuration files too.

 

(The only danger I see is when you have a large number of instances with
local changes, and you get bogged down with the UI. But there are some ENV
variables that can be used to auto-choose which version to install. The
utility leaves behind files with extensions like ".ucf-dist" and ".ucf-old"
as well so you can always go back and fix up your conf after the fact
manually.)

 

Anyway, food for thought!

 

David Cook

Senior Software Engineer

Prosentient Systems

Suite 7.03

6a Glen St

Milsons Point NSW 2061

Australia

 

Office: 02 9212 0899

Online: 02 8005 0595

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20230210/2d29118a/attachment.htm>


More information about the Koha-devel mailing list