[Debconf-devel] problem with debconf and auto-guessing config

Arthur de Jong adejong at debian.org
Tue Nov 11 21:58:30 UTC 2008


Hi, I hope this is the right place to ask this kind of question. If it
isn't just push me in the right direction ;)

I'm the maintainer of nss-ldapd (replacement for nss_ldap). I use
debconf for configuring my package (LDAP server to use, BASEDN, NSS
services to enable and more if debconf priority is low enough). Upon
installation reasonable defaults are guessed from the environment
(existing configuration file, configfiles of other packages,
environment, etc).

This is all done in the config script. The postinst just reads whatever
is in the debconf database and creates or modifies the config.

Everything works fine as with dpkg-reconfigure and dpkg -i but the
problem is when installing the package for the first time with apt. This
is what happens then:

- apt runs the preconfigure (arguments configure x.x):
  - debconf values get set from environment
  - questions are asked
- apt calls dpkg to install
  - postinst initis debconf which calls config (argument configure x.x):
    - debconf values get set from environment
    - questions aren't asked because we've been there already
  - postinst continues creating config with the values
    from the environment instead of the earlier answers

What is the best way to solve this problem? If I understand correctly in
config you can't determine from which point you are being run. I thought
about using the seen flag but that could cause problems for
dpkg-reconfigure.

The relevant files can be seen here:
http://arthurenhella.demon.nl/viewcvs/nss-ldapd/nss-ldapd/debian/

Thanks.

-- 
-- arthur - adejong at debian.org - http://people.debian.org/~adejong --
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/debconf-devel/attachments/20081111/d709a928/attachment.pgp 


More information about the Debconf-devel mailing list