Manage Interactive Input

From FAIWiki
Revision as of 10:28, 28 May 2010 by Bittner (talk | contribs) (→‎Syntax explained: re-formatted, more details)
Jump to navigation Jump to search

Some Debian packages request interactive input by a user for installation. This how-to describes how to handle such situations that usually produce an error in the installation process.

Problem (Example)

When installing Java (Debian package sun-java6-bin) the package requests you to accept Sun's license before the installation is effectively performed. If you have this package (or a package having a dependency to it) in a FAI class the installation may result in the following error:

sun-dlj-v1-1 license could not be presented
try 'dpkg-reconfigure debconf' to select a frontend other than noninteractive
dpkg: error processing ...

Note: The problem is debconf must ask for acceptance of the Java license. As aptitude runs in non-interactive mode it aborts installing the package.

Solution

Questions by debconf can be answered in the FAI config space in the debconf folder. This is called "debconf preseeding".

Debconf preseeding is done by adding to debconf/DEFAULT (or another file matching an FAI class) something like:

sun-java6-bin   shared/accepted-sun-dlj-v1-1    boolean true
sun-java6-jdk   shared/accepted-sun-dlj-v1-1    boolean true
sun-java6-jre   shared/accepted-sun-dlj-v1-1    boolean true

Syntax explained

The arguments on each line are separated by white space, and have the following meaning: (in sequential order)

  1. Package name
    • Name of the package to install that asks interactively for input
  2. Question name
    • (TODO: find out details and explain!)
  3. Answer value type
    • boolean
    • string
    • password
    • select
    • multiselect
  4. Answer value
    • The value to use for automated installation, comma-separated for multiselect

Examples: see the files in /var/lib/fai/config/debconf/ of your FAI host (or boot medium)!

References

More reading