lists.arthurdejong.org
RSS feed

Re: nslcd config and debconf

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

Re: nslcd config and debconf



On Wed, 2012-10-10 at 02:19 +0400, Vasiliy Molostov wrote:
> Instead, I have a dubious situation where my own selections are just  
> unconditionally overwritten where my wish is to recover initial package  
> config with configuration preferences I have already done previously.

To do this, the best way currently is to remove nslcd.conf and run
dpkg-reconfigure nslcd. This should work for nslcd but is not guaranteed
to work for other packages though. You will loose the part of the
configuration that isn't asked for in debconf questions though.

> Does it mean that "reconfigure" part (you mentioned before) is unsupported  
> in nslcd?

Reconfiguring with dpkg-reconfigure is supported. You can also preseed
the debconf database for installation but preseeding for reconfiguration
is not supported. When you reconfigure, you should use a debconf
frontend to ask the questions.

> I care here about my customized answers, that are unconditionally  
> overwriten with a good tool 'dpkg-reconfigure' due to config script, that  
> "cares" of my customizations via updating cached answers. Please, take  
> some attention to the fact that these  "carefully" saved parameters can  
> not be used anymore, since they are always to be updated by maintainer  
> script.

The information in debconf is supposed to be cached data.

If the nslcd scripts would always use the debconf database values
unconditionally the following would have unexpected behaviour:

- install the package as usual answering the debconf questions
- the postinst creates a configuration file with answers filled in
- the configuration file is modified by hand
- just running dpkg-reconfigure (or upgrading the package) will
  overwrite the manual changes with the debconf values

> Perhaps, I understand that this is more a debconf design issue, and nslcd  
> is always works as expected. But I suppose, that instead of unconditional  
> update and before reconfigure with debconf cache db at some important  
> parameter it is better to look at db contents - perhaps necessary value  
> there is already was set, and which came from already answered debconf  
> question.

The problem is that you cannot determine when a question was asked. If
this was possible you could check the timestamp of the configuration
file and use the configuration file value only if it is newer than the
last time the question was asked. This would complicate the debconf
handling even further and is very fragile.

> Perhaps they are unclear with that subject, but the awaiting from debconf  
> is very clear - store my answers to reuse them later.

From my understanding of the debconf database the answers are meant only
to be cached between the time the question is asked and when the package
postinst is executed.

Some historical background can be found here:
  https://lists.debian.org/debian-devel/2003/04/msg01294.html
Although it is a different package the mechanism that Joey Hess (the
original author of debconf) describes is what nslcd currently does
mostly.

I think debconf is an excellent way to configure packages but it is also
extremely difficult to get right and there are lots of subtle things
that can go wrong (see for example Debian bugs #637863, #645599, #670133
and #671464).

-- 
-- arthur - arthur@arthurdejong.org - http://arthurdejong.org --
-- 
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-users/