DEBCONF.CONF(5) | File Formats Manual | DEBCONF.CONF(5) |
debconf.conf - debconf configuration file
Debconf is a configuration system for Debian packages. /etc/debconf.conf and ~/.debconfrc are configuration files debconf uses to determine which databases it should use. These databases are used for storing two types of information; dynamic config data the user enters into it, and static template data. Debconf offers a flexible, extensible database backend. New drivers can be created with a minimum of effort, and sets of drivers can be combined in various ways.
# This is a sample config file that is
# sufficient to use debconf.
Config: configdb
Templates: templatedb
Name: configdb
Driver: File
Filename: /var/cache/debconf/config.dat
Name: templatedb
Driver: File
Mode: 644
Filename: /var/cache/debconf/templates.dat
The format of this file is a series of stanzas, each separated by at least one wholly blank line. Comment lines beginning with a "#" character are ignored.
The first stanza of the file is special, is used to configure debconf as a whole. Two fields are required to be in this first stanza:
Additional fields that can be used include:
For example, the first stanza of a file might look like this:
Config: configdb
Templates: templatedb
Each remaining stanza in the file sets up a database. A database
stanza begins by naming the database:
Name: configdb
Then it indicates what database driver should be used for this
database. See DRIVERS, below, for information about what drivers are
available.
Driver: File
You can indicate that the database is not essential to the proper
functioning of debconf by saying it is not required. This will make debconf
muddle on if the database fails for some reason.
Required: false
You can mark any database as readonly and debconf will not write
anything to it.
Readonly: true
You can also limit what types of data can go into the database with Accept- and Reject- lines; see ACCESS CONTROLS, below.
The remainder of each database stanza is used to provide
configuration specific to that driver. For example, the Text driver needs to
know a directory to put the database in, so you might say:
Filename: /var/cache/debconf/config.dat
A number of drivers are available, and more can be written with little difficulty. Drivers come in two general types. First there are real drivers -- drivers that actually access and store data in some kind of database, which might be on the local filesystem, or on a remote system. Then there are meta-drivers that combine other drivers together to form more interesting systems. Let's start with the former.
On the downside, the entire file has to be read in each time debconf starts up, and saving it is also slow.
The following things are configurable for this driver.
As example stanza setting up a database using this driver:
Name: mydb
Driver: File
Filename: /var/cache/debconf/mydb.dat
The following things are configurable for this driver.
As example stanza setting up a database using this driver:
Name: mydb
Driver: DirTree
Directory: /var/cache/debconf/mydb
Extension: .txt
This driver is configurable in the same ways as is the DirTree driver, plus:
As example stanza setting up a database using this driver:
Name: mydb
Driver: PackageDir
Directory: /var/cache/debconf/mydb
This database driver accesses a LDAP directory for debconf configuration data. Due to the nature of the beast, LDAP directories should typically be accessed in read-only mode. This is because multiple accesses can take place, and it's generally better for data consistency if nobody tries to modify the data while this is happening. Of course, write access is supported for those cases where you do want to update the config data in the directory.
For information about setting up a LDAP server for debconf, read /usr/share/doc/debconf-doc/README.LDAP (from the debconf-doc package).
To use this database driver, you must have the libnet-ldap-perl package installed. Debconf suggests that package, but does not depend on it.
Please carefully consider the security implications of using a remote debconf database. Unless you trust the source, and you trust the intervening network, it is not a very safe thing to do.
The following things are configurable for this driver.
An example stanza setting up a database using this driver, assuming the remote database is on example.com and can be accessed anonymously:
Name: ldapdb
Driver: LDAP
Readonly: true
Server: example.com
BaseDN: cn=debconf,dc=example,dc=com
KeyByKey: 0
Another example, this time the LDAP database is on localhost, and can be written to:
Name: ldapdb
Driver: LDAP
Server: localhost
BaseDN: cn=debconf,dc=domain,dc=com
BindPasswd: secret
KeyByKey: 1
The following things are configurable for this driver.
That's all of the real drivers, now moving on to meta-drivers..
Things become more interesting if one of the databases on the stack is readonly. Consider a stack of the databases foo, bar, and baz, where foo and baz are both readonly. Debconf wants to change an item, and this item is only present in baz, which is readonly. The stack driver is smart enough to realize that won't work, and it will copy the item from baz to bar, and the write will take place in bar. Now the item in baz is shadowed by the item in bar, and it will not longer be visible to debconf.
This kind of thing is particularly useful if you want to point many systems at a central, readonly database, while still allowing things to be overridden on each system. When access controls are added to the picture, stacks allow you to do many other interesting things, like redirect all passwords to one database while a database underneath it handles everything else.
Only one piece of configuration is needed to set up a stack:
For example:
Name: megadb
Driver: stack
Stack: passworddb, configdb, companydb
WARNING: The stack driver is not very well tested yet. Use at your own risk.
Backup
You must specify the following fields to set up this driver:
For example:
Name: backup
Driver: Backup
Db: mydb
Backupdb: mybackupdb
Debug
You must specify the following fields to set up this driver:
When you set up a database, you can also use some fields to specify access controls. You can specify that a database only accepts passwords, for example, or make a database only accept things with "foo" in their name.
Some of the database drivers use format modules to control the actual format in which the database is stored on disk. These formats are currently supported:
Here is a more complicated example of a debconf.conf file.
# This stanza is used for general debconf setup.
Config: stack
Templates: templates
Log: developer
Debug: developer
# This is my own local database.
Name: mydb
Driver: DirTree
Directory: /var/cache/debconf/config
# This is another database that I use to hold
# only X server configuration.
Name: X
Driver: File
Filename: /etc/X11/debconf.dat
Mode: 644
# It's sorta hard to work out what questions
# belong to X; it should be using a deeper
# tree structure so I could just match on ^X/
# Oh well.
Accept-Name: xserver|xfree86|xbase
# This is our company's global, read-only
# (for me!) debconf database.
Name: company
Driver: LDAP
Server: debconf.foo.com
BaseDN: cn=debconf,dc=foo,dc=com
BindDN: uid=admin,dc=foo,dc=com
BindPasswd: secret
Readonly: true
# I don't want any passwords that might be
# floating around in there.
Reject-Type: password
# If this db is not accessible for whatever
# reason, carry on anyway.
Required: false
# I use this database to hold
# passwords safe and secure.
Name: passwords
Driver: File
Filename: /etc/debconf/passwords
Mode: 600
Accept-Type: password
# Let's put them all together
# in a database stack.
Name: stack
Driver: Stack
Stack: passwords, X, mydb, company
# So, all passwords go to the password database.
# Most X configuration stuff goes to the X
# database, and anything else goes to my main
# database. Values are looked up in each of those
# in turn, and if none has a particular value, it
# is looked up in the company-wide LDAP database
# (unless it's a password).
# A database is also used to hold templates. We
# don't need to make this as fancy.
Name: templates
Driver: File
Mode: 644
Format: 822
Filename: /var/cache/debconf/templates
If you use something like ${HOME} in this file, it will be replaced with the value of the named environment variable.
Environment variables can also be used to override the databases on the fly, see debconf(7)
The field names (the part of the line before the colon) is case-insensitive. The values, though, are case sensitive.
More drivers and formats. Some ideas include: A SQL driver, with the capability to access a remote database. A DHCP driver, that makes available some special things like hostname, IP address, and DNS servers. A driver that pulls values out of public DNS records TXT fields. A format that is compatible with the output of cdebconf. An override driver, which can override the value field or flags of all requests that pass through it.
/etc/debconf.conf
~/.debconfrc
Joey Hess <joeyh@debian.org>