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

Problems with Debconf



Hi,

it seems I'm being stupid here, so please help me.

A package wants to use debconf to make some changes to the configuration
(e.g. change a setting in a configuration file from "false" to "true" or
vice versa, or change the permissions of a file).  But since it knows
that "debconf is not a registry", it must look at the system (parse the
configuration file, get the permissions of that file) in its config
script, set the debconf template to give the answer that won't change
anything, and then ask the questions.  As far as I understood it, this
is the only way to ensure that a local configuration change will not be
overwritten on a system with DEBIAN_FRONTEND=noninteractive.

So far so good.  But what happens if the local admin uses an interactive
frontend, and wants to change something - e.g. by calling
dpkg-reconfigure?  This is what is going on, at least if apt-utils are
installed:

1. config script is run, finds setting "false" in config file, 
   "db_set question false".  Then it asks the question, and the admin
   answers "true", so now the debconf database has "true".

2. The postinst script is run and loads debconf.  debconf first executes
   the config script, then rexecutes the postinst script, so we have:

2.a config script is run, finds setting "false" in config file, 
    "db_set question false".  This time, the question is not asked
    again, so now the debconf database has "false".

2.b the postinst script queries the debconf database and finds that it
  doesn't need to change the setting.


Either there is an error in the description above, or I'm missing a
fundamental idea of making the config script idempotent without reasking
questions.  Can you help me out?

Regards, Frank
-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer



Reply to: