UCFR(1) | Debian GNU/Linux manual | UCFR(1) |
ucfr - Update Configuration File Registry: associate packages with configuration files
ucfr [options] <Package> <Path to configuration file>
Where Package is the package associated with the configuration file (and, in some sense, its owner), and Path to configuration file is the full path to the location (usually under /etc) where the configuration file lives, and is potentially modified by the end user. Please note that usually this means that we register actual files, and not symbolic links to files. ucfr will follow symbolic links and register the real file, and not the symbolic link.
This script maintains an association between configuration files and packages, and is meant to help provide facilities that dpkg provides conffiles for configuration files and not shipped in a Debian package, but handled by the postinst by ucf instead. This script is idempotent, associating a package to a file multiple times is not an error. It is normally an error to try to associate a file which is already associated with another package, but this can be overridden by using the --force option.
The most common case usage is pretty simple: a single line invocation in the postinst on configure, and another single line in the postrm to tell ucfr to forget about the association with the configuration file on purge (using the --purge option) is all that is needed (assuming ucfr is still on the system).
/var/lib/ucf/registry, and /var/lib/ucf/registry.X, where X is a small integer, where previous versions of the registry are stored.
/etc/ucf.conf
If the package foo wants to use ucfr to associate itself with a configuration file foo.conf, a simple invocation of ucfr in the postinst file is all that is needed:
ucfr foo /etc/foo.conf
On purge, one should tell ucf to forget about the file (see detailed examples in /usr/share/doc/ucf/examples):
ucfr --purge foo /etc/foo.conf
If you want to remove all the conf files for a given package foo, the simplest way is to use ucfq. For example
ucfq -w foo | cut -d : -f 1 | while read cfile ; do ucfr -v $cfile ; done
This manual page was written Manoj Srivastava <srivasta@debian.org>, for the Debian GNU/Linux system.
Feb 16 2018 | Debian |