Re: use and abuse of debconf
Sam Hartman wrote:
> Actually, this isn't quite right. Consider what happens if you manage
> to set up debconf so it always reasks questions
> * config script reads /etc file
> * config script asks question
> * admin changes value
Actually, this will only happen during an intial install. Debconf
never re-asks questions when it is preconfiguring a package in apt mode.
So we only have to look at the case where this is an intial install:
> * config script updates debconf database
> * unpacking happens
> * config script gets called by postinst
> * config script reads /etc file and overwrites admin choices
Ah, but during an initial install, there is no /etc file (we're
modifying it, so it cannot be a conffile, so it must not be in the
package), so this doesn't happen.
Maybe it'll be clearer if I list the possible scenarios:
Scenario A: debconf not set to re-ask questions; initial install
* config script skips nonexistant /etc file
* config script asks question
* admin changes value
* config script updates debconf database
* unpacking happens
* config script gets called by postinst
* config script skips nonexistant /etc file
* config script doesn't re-ask the question
* postinst writes out admin's answer
Scenario B: debconf set to re-ask questions; initial install
* config script skips nonexistant /etc file
* config script asks question
* admin changes value
* config script updates debconf database
* unpacking happens
* config script gets called by postinst
* config script skips nonexistant /etc file
* config script re-asks question (different from above A)
* admin changes value
* postinst writes out admin's answer
Scenario C: debconf set to not re-ask questions; upgrade
* config script reads /etc file
* config script doesn't re-ask the question
* unpacking happens
* config script gets called by postinst
* config script reads /etc file
* config script doesn't re-ask the question
* postinst writes out value that was read in from /etc file
Scenario C: debconf set to re-ask questions; upgrade
* config script reads /etc file
* config script doesn't re-ask the question (because debconf is smart about this)
* unpacking happens
* config script gets called by postinst
* config script reads /etc file
* config script asks question
* admin changes value
* postinst writes out admin's answer
Scenadio D: reconfiguring the package
* config script reads /etc file
* config script re-asks the question since this is a reconfiguration
* admin changes value
* config script updates debconf database
* postinst is run. It does NOT re-run the config script
* postinst writes out admin's answer
> To solve this in my krb5 packages, I introduced a config template that
> the user never sees which basically says whether the package has
> written out the last set of debconf edits. It's ugly, I don't like
> it, but it works better than anything I've thought of.
I don't see how you could have experienced any such problem unless you
were using an ancient version of debconf (<< 0.2.71).
That said, I know that having the config script re-run from the postinst
is disgusting; I do have plans to eventually not require that, but it
requires dpkg modifications.
--
see shy jo
Reply to: