Check for installed DB Backend

Issue #58 wontfix
Former user created an issue

When installing iRedMail on Ubuntu. If you choose OpenLDAP as Backend and already have mariadb-server installed, the installation will fail due to that it's trying to install mysql-server. There should be a check in functions/ where it identifies if mysql-server or mariadb-server is already installed. If none is installed, you should be able to choose if you want to use MySQL or MariaDB as "secondary" backend.

This may also be true for other distributions and choice of backend.

Best Regards Johan Olsson

Comments (9)

  1. Johan Olsson

    Hi, I'm using Ubuntu 14.04 LTS. But it won't matter in this case since this will happen for all Debian and Ubuntu releases. If you check functions/ and go to the part where you have chosen OpenLDAP as Backend, it won't check if you have either MySQL or MariaDB preinstalled.

        elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
            ALL_PKGS="${ALL_PKGS} postfix-ldap slapd ldap-utils libnet-ldap-perl mysql-server mysql-client"

    So if you already have MariaDB installed. This part will make the install script fail as it will try to install mysql-server. So if you have already installed MariaDB, you simply need to remove mysql-server and mysql-client and the installation will continue.

    I suggest to add a check. That if you've added the MySQL parameters in the installation script, it shouldn't try to install mysql-server. As you won't need mysql-server installed on the local server if you already have added the MySQL parameters. Or add another parameter which is MYSQL_REMOTE which should be true or false.

    MYSQL_REMOTE='true' MYSQL_SERVER='' MYSQL_ROOT_USER='admin_iredmail' MYSQL_GRANT_HOST='%' bash

  2. Johan Olsson

    I agree that you can do that. But I think it will be easier for everyone if you check if there is a sql backend installed. Or if you add, for example MYSQL_REMOTE parameter, it should not try to install a sql backend. Just a suggestion that will minimize problems when doing new installations.

  3. Zhang Huangbin repo owner

    You got it. If you choose OpenLDAP as backend, iRedMail installer will ask you to choose either MySQL or MariaDB as SQL server used to store application data. (No plan to make PGSQL available here.)

    Note: not all distributions have both MySQL and MariaDB available, so currently only Debian/Ubuntu/FreeBSD have this dialog page.

    Screen Shot 2015-05-26 at 10.17.41 AM.png

  4. Zhang Huangbin repo owner

    After some more testing on Ubuntu, i'm afraid that i have to revert this change.

    On Ubuntu 14.04, if we install mariadb-server, it requires mariadb-client. it's ok so far. but other packages requires mysql-client, this brings conflict and interrupt iRedMail installation.

    So, i will revert this change.

  5. Zhang Huangbin repo owner

    Dear all,

    I'm going to close this issue and mark it as WONTFIX (won't be fixed).

    iRedMail requires a new/fresh/clean server os to make everything predictable, this way we can ensure a smooth installation. I agree that some additional checks to use existing components will make it more useful, but it makes installation more complex. So, let's keep it simple, and keep the installer stupid.

  6. Log in to comment