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

Re: debconf database and config files

Christoph Biedl wrote:
> The given "config" file sources $CONFIGFILE if present but asserts
> FOO and BAR are defined there.  Is this safe?  I'd rather wipe out any
> pre-existing values:
>     # Load config file, if it exists.
>     if [ -e $CONFIGFILE ]; then
> +       FOO=
> +       BAR=
> 	. $CONFIGFILE || true

I belive this is good practice to do. (In init scripts too.)

> * "postinst" sample
> If I understand correctly, all the logic shown applies only for the
> "configure" invocation.  Or did I miss something?  Therefore the
> sample should be embedded in a switch like

If you look in HACKS, it describes why sourcing the confmodule needs to
be before nearly anything else in your script. So I prefer to keep it
very close to the top in my examples.

> * config file default values
> It is quite common to ship a /etc/default/daemon in the package.
> However, this leads to the situation that default values are stored in
> three different locations:
> * debian/default as set up by the maintainer
> * debian/template for debconf
> * debian/postinst where the file is created if missing
> I doubt this is the best solution.

If you're managing the file with debconf, then it should not be a
conffile, so should not be included in the package.

I don't see any need to hardcode the default value in the postinst.

see shy jo

Attachment: signature.asc
Description: Digital signature

Reply to: