Re: Problems with using debconf in init script...
Michael Bramer <grisu@debian.org> writes:
> On Mon, Jan 29, 2001 at 04:44:29PM -0800, Philippe Troin wrote:
> > Michael Bramer <grisu@debian.org> writes:
> > > > The am-utils init script (enclosed here) uses debconf to retrieve the
> > > > configuration information.
> > >
> > > NO!
> > >
> > > Don't use debconf in
> > > - init-script
> > > - in the Program itself
> >
> > Who says that ? Is this policy or written anywhere ?
>
> 1.) ask joey hess
He hates it, and I now agree with him and you in that is a ugly method.
> 2.) read /usr/doc/debconf/introduction.txt.gz
I read it. Three times.
> debconf is way to ask questions from the user, store this answers to
> pursue:
> - don't ask question several times
> - use the same (unexchangeable) frontend all the time
> - ask all question befor installing the package
>
> it is not a registry ala MS and it don't replace /etc/*
Want it or not, it's very registry-like...
8< snip >8
> > > And I configure my system with the vi[m] and not with dpkg-reconfig !
> > >
> > > Ask with debconf, write a config-file and ask this config-file.
> >
> > This means that the info is stored twice:
> >
> > - in the "config file".
> >
> > - in the debconf database.
>
> no. The information is store only in the configuration file. The
> programm, the init.d-script ... show only on this file, not in
> debconf.
No, it is stored in two places, debconf and the "config" file.
Meta: I hate to call these "config" files, since these "config"
files cannot be "conffiles". They cannot be conffiles because they
are changed *automatically* during the configuration process.
I agree that the rest of the system should only look into the "config"
file, but we still have duplicate information.
> > What should happen if the "config file" is changed outside of debconf
> > and then a change is made with debconf ?
>
> See policy '4.7.3. Behavior' :
>
> Configuration file handling must conform to the following behavior:
>
> * local changes must be preserved during a package upgrade
>
> * configuration files should be preserved when the package is
> removed, and only deleted when the package is purged.
Again, this debconf generated file cannot be a conffile, so this
section does not apply.
However I agree that manual changes to the "config" file should be kept.
> don't update the configuration file on a update, only on user request
> (dpkg-reconfigure or after a purge)
Then again, manual changes might be lost.
> > I hope by "config file" you do not mean conffile. A conffile should
> > never be modified automatically (except by dpkg).
>
> set 'config file' = configuration file
test "${config file} != "conffile" || {echo "misunderstanding" 1>&2; exit 1}
Phil.
Reply to: