5

I'm trying to set default answers to debconf to automate exim config. I'm setting up new values with debconf-set-selections, but debconf ignores it. I'm puzzled. Here is a short copy/paste of my problem :

root@vm-iwd:/var/cache/debconf# debconf-get-selections | grep exim4/dc_eximconfig_configtype
exim4-config    exim4/dc_eximconfig_configtype  select  mail sent by smarthost; no local mail
root@vm-iwd:/var/cache/debconf# echo "exim4-config exim4/dc_eximconfig_configtype select internet site; mail is sent and received directly using SMTP" | debconf-set-selections
root@vm-iwd:/var/cache/debconf# debconf-get-selections | grep exim4/dc_eximconfig_configtype
exim4-config    exim4/dc_eximconfig_configtype  select  internet site; mail is sent and received directly using SMTP
root@vm-iwd:/var/cache/debconf# dpkg-reconfigure exim4-config -fnoninteractive
[ ok ] Stopping MTA for restart: exim4_listener.
[ ok ] Restarting MTA: exim4.
root@vm-iwd:/var/cache/debconf# debconf-get-selections | grep exim4/dc_eximconfig_configtype
exim4-config    exim4/dc_eximconfig_configtype  select  mail sent by smarthost; no local mail    

You see how debconf is ignoring my set-selections ? I tried to edit directly /var/cache/debconf/config.dat and try to use DEBCONF_DB_OVERRIDE, none of these methods works

I'm on debian 7.6, fresh netinst install.

Any ideas ?

chicks
  • 3,639
  • 10
  • 26
  • 36
DeLoVaN
  • 91
  • 6
  • Debconf is used when a package is installed. Once it has been installed many packages do not use it. So set the config before exim is installed, or just modify the config files after the fact. – Zoredache Jul 23 '14 at 16:19
  • 2
    I agree but you can redefine exim conf by simply running dpk-reconfigure exim4-config in interactive mode. When you do that, the properties are correctly set. Besides, it's not the only package where I have the problem. Trying to reconfigure locales via non-interactive debconf also gave me no result. I had to edit /etc/locale.gen and running dpkg-reconfigure locales. – DeLoVaN Jul 23 '14 at 16:27
  • 1
    `I agree but you can redefine exim conf by simply running dpkg-reconfigure exim4-config in interactive mode.` - My original point stands. **You typically can't use pre-seeding to change things after the fact.** Once the package is installed debconf will parse the real configuration files and extract their values, and ignore the preseed database! Look at the exim4 config script `/var/lib/dpkg/info/exim4-config.config`, it dot sources `/etc/exim4/update-exim4.conf.conf` to load the **current** values. If that file exists, then no default values are loaded. – Zoredache Jul 23 '14 at 16:48
  • Its a good question. It is strange that you cant input debconf-get-selection format data straight into dpkg-reconfigure. I've seen ine configuration engine mangle a debconf database dump and use dpkg-reconfigure "editor" mode to get it updated. – spinkus Dec 22 '14 at 11:48

1 Answers1

4

Ok, so as Zoredache stated, modifying debconf default answers is not the solution.

So to change my config, I did the following :

  • Change /etc/exim4/update-exim4.conf.conf (eg. sed -i "s/dc_eximconfig_configtype=.*/dc_eximconfig_configtype='internet'/" /etc/exim4/update-exim4.conf.conf)
  • Run dpkg-reconfigure exim4-config -fnoninteractive
DeLoVaN
  • 91
  • 6
  • This works not only for re-configuring but also for a brand new installation of the exim4 package. Tested and documented here (https://stackoverflow.com/a/61518823/198219). – famzah Apr 30 '20 at 08:17