Installing packages that use dbconfig-common on Debian

720 views
Skip to first unread message

Craig Box

unread,
Aug 10, 2010, 6:20:39 AM8/10/10
to puppet...@googlegroups.com
I have been trying to use Puppet to install the Zabbix server, which uses dbconfig-common to set up its database.

If you don't do anything more than package { "zabbix-server-mysql": ensure => installed }, then you end up with errors that look much like this (snipped for brevity) :

err: //zabbix::server/Package[zabbix-server-mysql]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install zabbix-server-mysql' returned 100: Reading package lists...
Building dependency tree...
Reading state information...

Preconfiguring packages ...
.: 3: Can't open /usr/share/dbconfig-common/dpkg/config.mysql
zabbix-server-mysql failed to preconfigure, with exit status 2
Fetched 5659kB in 0s (9017kB/s)

Setting up zabbix-server-mysql (1:1.8.1-1ubuntu1) ...
dbconfig-common: writing config to /etc/dbconfig-common/zabbix-server-mysql.conf

Creating config file /etc/dbconfig-common/zabbix-server-mysql.conf with new version

Creating config file /etc/zabbix/zabbix_server.conf with new version
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2).
unable to connect to mysql server.
error encountered creating user:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
dbconfig-common: zabbix-server-mysql configure: aborted.
dbconfig-common: flushing administrative password
dpkg: error processing zabbix-server-mysql (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 zabbix-server-mysql
E: Sub-process /usr/bin/dpkg returned an error code (1)

In short, it's expecting that you have answered questions about its MySQL root password.

If you install the package manually, the first question you are asked is whether or not you want to use dbconfig-common, and a warning that if you already have a database set up, you don't want to use it.  It seem to influence the value for the dbconfig-install key.  Therefore, it stands to reason that if I preseed this key:

   zabbix-server-mysql zabbix-server-mysql/dbconfig-install boolean false

then I should get what I want.  However, I don't - still prompted, still fails to install silently, etc.

As this question probably comes up a lot for people installing software through Puppet, has anyone come up with a satisfactory solution to tell debconf/dbconfig-common to just get out of the way entirely?

Craig


Paul Hamby

unread,
Aug 12, 2010, 1:35:48 PM8/12/10
to Puppet Users
We created a definition in our "apt" module called preseed_package and
then we call

apt::preseed_package { <package_name>:

ensure => present,

}


You can then create a preseed file for that package and have puppet
put it on the host.

From our "apt" module:
define preseed_package ( $ensure ) {



file { "/var/local/preseed":

ensure => directory,

}



file { "/var/local/preseed/$name.preseed":

source => "puppet:///apt/preseed/$name.preseed",

mode => 600,

backup => false,

}



package { "$name":

ensure => $ensure,

responsefile => "/var/local/preseed/$name.preseed",

require => File["/var/local/preseed/$name.preseed"],

}



}



Paul

Nigel Kersten

unread,
Aug 12, 2010, 2:11:38 PM8/12/10
to puppet...@googlegroups.com
Paul, have you seen http://projects.puppetlabs.com/issues/2349 ?

If more people watch that, I'm more likely to prioritize doing that :)

Alternative suggestions welcome.

> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>
>

--
nigel

Craig Box

unread,
Aug 13, 2010, 4:15:00 AM8/13/10
to Puppet Users
Thanks Paul; I don't have a problem getting the preseed onto the
system, it's just that dbconfig-common totally ignores the fact you've
tried to preseed it out of existence. :)

I may have to take this to the Debian bugtracker.

Craig
Reply all
Reply to author
Forward
0 new messages