Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 08-20-2010, 07:25 AM   #1
LQ Newbie
Registered: Dec 2009
Posts: 1

Rep: Reputation: 0
[solved] what do I mess up while using debconf in my package? :)


I'm actually using debconf to prompt the user some informations that I'll need after he deployed the .deb.

Following the documentation, here is what I understood from the process:

1) declare depends: debconf (>= 0.2.17) in the debian/control file (I just need debconf for my postinst script so I won't need to declare it in the build-depends)
2) create the debian/*.template file and insert in it your questions/message, respecting the syntax (found on the debian-policy)
3) Create the debian/config file. This file will handle the code (in bash, python or Perl) that will use the questions/messages declared in debian/template to prompt the user or answer him. The datas grabed by this script will be stored in a special db (I suppose that it is a file database).
4) those datas are transmitted (I should say invoked in) to the postinst script that will use them for whatever he wants (in my case it will be setup a login/password for a mysql database)

My questions are:

- How the config file is called? shall I call it in my install rule in debian/rules? Is it mandatory to create it in a subdirectory of debian/ (debian/tmp/DEBIAN/)?
- Is it possible to check the questions/answer without using them in the postinst script? I mean for example I'd like to just declare the questions and answers in debian/packagename.template, use them in debian/config script, build the package and then check if they are well prompted while deploying the package (basic dpkg -i mypackage.deb)

At the moment I simply followed the tutorial provided by Mr.Hess ( I copied and paste the bash code for the template and config files (replacing the packages names with mines), and didnt set up a postinst file, but it obviously did nothing. I also didnt touch to my base debian/rules file.
The package is well build by dpkg-buildpackage -us -uc, and my program is well deployed, but I'm never prompted for the question declared in debian/packagename.templates and used in debian/config.
Result is the same if I place my files in the tmp/DEBIAN subdirectory.

Thanks in advance for any help provided

edit: self solved a few days ago.

To explain a bit, I was not understanding well debconf. for a simple questions prompts, do as following:

1) write a template file, containing the questions
2) write a config file, that will input the question during the installation
3) get the answers (stored in the debconf database) in the postinst script and do whatever you want with them.

I need to explore a bit more to implement verification and validation for the questions during the prompt.Debconf can do a lot more and be used in others scripts like prerm, postrm, etc...

Hope this helps.

Last edited by RoyalBacon; 08-24-2010 at 04:47 AM. Reason: solved


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian package management - how are debconf and dpkg-deb related? austinium Debian 5 03-08-2010 06:25 AM
Debconf and debhelper... CoffeeKing!!! Linux - Software 1 03-19-2008 07:34 PM
debconf help need salahuddin_66 Debian 1 04-25-2005 04:53 PM
debconf upgrade problem zvonSully Debian 1 01-27-2005 04:36 PM
problem with debconf and X configuration Miky Linux - General 0 02-24-2003 05:39 PM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:28 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration