1 (edited by foxi 2019-04-25 20:21:54)

Topic: installer.sh broken for FreeBSD 11.2 ?

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? iRedMail.sh installer
- Linux/BSD distribution name and version: FreeBSD 11.2-RELEASE-p9
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? 0 so far
====

Hello,

I succesfully use iRedMail on Linux for some years. I have solid Linux experience, but only lightweight FreeBSD experience.
I am currently investigating to maybe move to a FreeBSD 11.2 (FreeNAS 11.2U3 iocage jail if that matters) and doing a test setup.

Downloaded the installer and did the following:

portsnap fetch extract update
pkg install bash-static sudo
./iRedMail.sh

That got stuck on MariaDB:

===>  mariadb103-client-10.3.14 You are using OpenSSL from ports and have
selected GSSAPI from base, please select another GSSAPI value.
*** Error code 1

A quick search leaded me to a solution. Add the following to /etc/make.conf (although that is already defined in functions/packages_freebsd.sh ?):

OPTIONS_UNSET+= GSSAPI_BASE
OPTIONS_SET+=   GSSAPI_NONE

Another try and this time it went very far and did a lot of work. But then i got compiler errors:

cc -DNDEBUG -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -fPIC -I/usr/local/include/python2.7 -c build/temp.freebsd-11.2-STABLE-amd64-2.7/_openssl.c -o build/temp.freebsd-11.2-STABLE-amd64-2.7/build/temp.freebsd-11.2-STABLE-amd64-2.7/_openssl.o -Wconversion -Wno-error=sign-conversion

[... lot of warnings...]
build/temp.freebsd-11.2-STABLE-amd64-2.7/_openssl.c:2498:21: error: redefinition of 'DTLS_method' as
      different kind of symbol
const SSL_METHOD *(*DTLS_method)(void) = NULL;
                    ^
/usr/local/include/openssl/ssl.h:1474:19: note: previous definition is here
const SSL_METHOD *DTLS_method(void);            /* DTLS v1.0 or later */
                  ^
build/temp.freebsd-11.2-STABLE-amd64-2.7/_openssl.c:2499:21: error: redefinition of 'DTLS_server_method' as
      different kind of symbol
const SSL_METHOD *(*DTLS_server_method)(void) = NULL;
                    ^
/usr/local/include/openssl/ssl.h:1475:19: note: previous definition is here
const SSL_METHOD *DTLS_server_method(void);     /* DTLS v1.0 or later */
                  ^
build/temp.freebsd-11.2-STABLE-amd64-2.7/_openssl.c:2500:21: error: redefinition of 'DTLS_client_method' as
      different kind of symbol
const SSL_METHOD *(*DTLS_client_method)(void) = NULL;
[... lot of warnings...]

Is this known ? Did i make a mistake ? Anyone with the same problems ?

Or even better, anyone with a solution ? ;-)

Cheers,

Serge

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: installer.sh broken for FreeBSD 11.2 ?

Make sure you have these settings in file /var/db/ports/databases_mariadb103-server/options:

OPTIONS_FILE_UNSET+=GSSAPI_BASE
OPTIONS_FILE_UNSET+=GSSAPI_HEIMDAL
OPTIONS_FILE_UNSET+=GSSAPI_MIT
OPTIONS_FILE_SET+=GSSAPI_NONE

Then re-run iRedMail installer with "bash":

bash iRedMail.sh

3

Re: installer.sh broken for FreeBSD 11.2 ?

by the way, we recommend Linux for production server because we do more testings with Linux and more iRedMail users deploy Linux for production mail server.

4

Re: installer.sh broken for FreeBSD 11.2 ?

Thumbs up. This worked :-)

So for everyone finding this thread and experimenting with iRedMail 0.9.9 on FreeNAS 11.2u3 here are the steps to get it running on a freshly created jail. Downloading iRedMail and un-tar-ing it is not covered here.

portsnap fetch extract update
pkg install bash-static
mkdir -p /var/db/ports/databases_mariadb103-server

Create a file called options (vi /var/db/ports/databases_mariadb103-server/options) with the following content:

OPTIONS_FILE_UNSET+=GSSAPI_BASE
OPTIONS_FILE_UNSET+=GSSAPI_HEIMDAL
OPTIONS_FILE_UNSET+=GSSAPI_MIT
OPTIONS_FILE_SET+=GSSAPI_NONE

Then start the installer

bash ./iRedMail.sh

It will fail.
Add the following to the now created /etc/make.conf (vi /etc/make.conf):

OPTIONS_UNSET+= GSSAPI_BASE
OPTIONS_SET+=   GSSAPI_NONE

Retry and it will work. But it will take a veeeery long time ...

bash ./iRedMail.sh

While i see some emails with error messages on my first postmaster login i will not go deeper at the moment. This was only a POC to see if i could migrate my existing iRedMail to a FreeNAS jail if i decide to replace my ESXi server with FreeNAS. Here is an example of one of these error messages, and i am sure this can be very easily solved once i wanted to go in production:

/usr/local/bin/python /opt/iredapd/tools/spf_to_greylist_whitelists.py >/dev/null

Traceback (most recent call last):
  File "/opt/iredapd/tools/spf_to_greylist_whitelists.py", line 69, in <module>
    from libs import utils, dnsspf
  File "/opt/iredapd/tools/../libs/utils.py", line 16, in <module>
    from libs.logger import logger
  File "/opt/iredapd/tools/../libs/logger.py", line 22, in <module>
    _handler = SysLogHandler(address=_server, facility=settings.SYSLOG_FACILITY)
  File "/usr/local/lib/python2.7/logging/handlers.py", line 761, in __init__
    self._connect_unixsocket(address)
  File "/usr/local/lib/python2.7/logging/handlers.py", line 804, in _connect_unixsocket
    self.socket.connect(address)
  File "/usr/local/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 2] No such file or directory

So thank you @ZhangHuangbin

5

Re: installer.sh broken for FreeBSD 11.2 ?

foxi wrote:

socket.error: [Errno 2] No such file or directory

This requires a new setting in iRedAPD config file /opt/iredapd/settings.py:

SYSLOG_SERVER = '/var/run/log'

syslog daemon generates /dev/log on Linux, but FreeBSD gets /var/run/log.

6

Re: installer.sh broken for FreeBSD 11.2 ?

thank you zang for detail info installing iredmail in FreeBSD 11.2.

i have successfuly install but, after reboot too many error in /var/log/messages about php-fpm like this

root@nmail:/usr/home/dani # tail -f /var/log/messages
May  4 09:42:29 nmail php-fpm[835]: [NOTICE] [pool inet] child 2580 exited with code 0 after 15.000080 seconds from start
May  4 09:42:29 nmail php-fpm[835]: [NOTICE] [pool inet] child 2583 started
May  4 09:42:44 nmail php-fpm[835]: [NOTICE] [pool inet] child 2583 exited with code 0 after 14.988160 seconds from start
May  4 09:42:44 nmail php-fpm[835]: [NOTICE] [pool inet] child 2585 started
May  4 09:42:59 nmail php-fpm[835]: [NOTICE] [pool inet] child 2585 exited with code 0 after 15.024091 seconds from start
May  4 09:42:59 nmail php-fpm[835]: [NOTICE] [pool inet] child 2588 started
May  4 09:43:14 nmail php-fpm[835]: [NOTICE] [pool inet] child 2588 exited with code 0 after 14.979908 seconds from start
May  4 09:43:14 nmail php-fpm[835]: [NOTICE] [pool inet] child 2593 started
May  4 09:43:29 nmail php-fpm[835]: [NOTICE] [pool inet] child 2593 exited with code 0 after 14.993478 seconds from start
May  4 09:43:29 nmail php-fpm[835]: [NOTICE] [pool inet] child 2596 started
May  4 09:43:44 nmail php-fpm[835]: [NOTICE] [pool inet] child 2596 exited with code 0 after 15.001164 seconds from start
May  4 09:43:44 nmail php-fpm[835]: [NOTICE] [pool inet] child 2599 started


Any info to resolve this problem?

Many thanks

7

Re: installer.sh broken for FreeBSD 11.2 ?

Increase the prefork php-fpm child processes will fix it (in /usr/local/etc/php-fpm.d/www.conf). For example:

pm.max_children = 100
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 100

8

Re: installer.sh broken for FreeBSD 11.2 ?

ZhangHuangbin wrote:

Increase the prefork php-fpm child processes will fix it (in /usr/local/etc/php-fpm.d/www.conf). For example:

pm.max_children = 100
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 100

Thankyou for solutions.

php-fpm seems to be normal