[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: preferred method for coexistence of debconf- and manual parts in conffiles?



On Wed, Nov 05, 2003 at 03:03:24PM +0100, Frank Küster wrote:
> if a package wants to use debconf to manage a configuration file, but
> still let the user have the option to manually add entries - is there a
> preferred way how to do this?

Parse the file and only change the debconf-managed options, the
debconf-devel manpage has an example. Which can be difficult.

[...]
> Put the information from the debconf database into the file, but between
> markers ### begin DEBCONF section for $package...  ### end DEBCONF
> section for $package. So an admin can add his customization before or
> after that, and upon dpkg-reconfigure or an upgrade only the part
> between the markers will be changed. 

> Is this concept o.k.? I couldn't find anything in the policy about that.

I think it is lot better than
"May I overwrite any manual changes to the file?" <Yes> <No>
but it tends not to work to well, because users tend to miss the fat
README. Which is why XFree86 recently dumped this approach.

> Here's why I come to ask the question: Recently, a bug was filed against
> tetex-bin, #209395, criticizing that a configuration file, language.dat,
> is not in /etc, but under /var. The reason why it was put there was that
> it was a generated file: Not user-editable, the only way was to run
> dpkg-reconfigure. A user that wants his own, manually edited file can
> still create it under /etc and divert the link that now points from
> /usr/share/texmf/tex/generic/config/language.dat to
> /var/lib/texmf/language.dat, so that it will point to his own file. He
> should have answered "no" to the question wether debconf should manage
> this file if he wants to do that. But it's not necessary for his setup
> to work - until he accidently accepts a change debconf proposes upon
> upgrade and wonders why it has no effect...

> The problem with that is, as pointed out in the bug report, is that now
> both the debconf database and language.dat are under /var, where backups
> are rarely done on homeusers systems, and he wants it under
> /etc.

> I would prefer it to be under /etc also because it _is_ a configuration
> file, and thus it belongs there. But to preserve the possibility of
> local additions, I would like to find a way for co-existence of
> debconf-managed and manually-edited parts.

A combination of ucf and debconf as in XFree86 might do the trick.

There is just a minor gotcha, #194152, you'll have to redirect ucf's
stdin to /dev/tty.
              cu andreas



Reply to: