Icinga / deb-icinga2

MOVED to GitLab see link - Debian/Ubuntu packaging for Icinga 2
https://git.icinga.com/packaging/deb-icinga2
0 stars 2 forks source link

icinga2-ido-mysql fails to init database if being installed together with mariadb-server #9

Closed Al2Klimov closed 5 years ago

Al2Klimov commented 5 years ago

Steps to reproduce

  1. Spin up a fresh Debian 9 system – either bare metal or fully virtualized
  2. # wget -O - https://packages.icinga.com/icinga.key | apt-key add -
  3. # cat <<EOF >>/etc/apt/sources.list
    deb http://packages.icinga.com/debian icinga-stretch main
    deb-src http://packages.icinga.com/debian icinga-stretch main
    EOF
  4. # apt update
  5. # apt install icinga2-{bin,ido-mysql} mariadb-server
    • "Enable Icinga 2's ido-mysql feature?" – yes
    • "Configure database for icinga2-ido-mysql with dbconfig-common?" – yes
    • "MySQL application password for icinga2-ido-mysql:" – "123456"
    • "Password confirmation:" – "123456"
    • "Password of the database's administrative user:" (what for?) – ""

Result

"An error occurred while installing the database: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory") . (...)"

lazyfrosch commented 5 years ago

This is a common problem, there is no hard relation between icinga2 and any database server.

Main reason is because we can't depend on anything.

You first need to install mariadb-server, and then any package that uses dbconfig-common or directly uses the database.

I have no better solution...

Al2Klimov commented 5 years ago

If dbconfig-mysql (or whatever the package name is) would suggest (not depend on) mariadb-server, would mariadb-server be configured before dbconfig-mysql?

lazyfrosch commented 5 years ago

No it won't help: https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends

A Depends field takes effect only when a package is to be configured. It does not prevent a package being on the system in an unconfigured state while its dependencies are unsatisfied, ...

(The other three dependency fields, Recommends, Suggests and Enhances, are only used by the various front-ends to dpkg such as apt-get, aptitude, and dselect.)