I had to change the root password for MySQL on a server. Exim also uses MySQL for users etc.
I didn't think Exim/Dovecot used that password, but now things are not working well and I'm pretty sure they are related.
When I try to start Exim:
Starting exim: Error loading mysql.so: /usr/lib64/exim/4.72-6.6.amzn1/lookups/mysql.so: undefined symbol: mysql_servers
2014-09-13 19:13:22 Error loading lookup module mysql.so: NULL
Running service --status-all
gives me
exim dead but subsys locked
I've checked for /eximdisable in /etc/, nothing there.
Disk space is 85% used, file handles 7% used.
It turns out that it has nothing to do with the gcc version or optimization failures. Instead, it's an incomplete compile/link of the exim binary. There is a flag (-rdynamic) for gcc to tell the linker to export the symbols to be visible to dynamically loaded modules. This flag must be passed to gcc when building the mysql.so and when building the Exim binary.
If this RPM is based on a Fedora exim.spec file (mine was), I've found that there are patches that set the LFLAGS variable in
Local/Makefile
, but then the make command overrides LFLAGS on the commandline. Simply move whatever you are setting LFLAGS to into your Local/Makefile and remove it from the make command:Othersie, it's likely that all you need is to add to the end of your
Local/Makefile
:More detail is available here: https://stackoverflow.com/a/482556/611911
Note: While you accepted the first answer I provided, all it really does is say "yeah, I had the problem too." This answer actually fixes the problem. :-)
Exim
can't loadmysql.so
because it hasn't built. You have to ensure you have at leastmysql-client
installed properly.I have seen this recently. I built some Exim 4.84 rpms for a friend on Amazon EC2 servers based on CentOS 6 (you don't say which version of Amazon's servers you are running). I had to reconfigure the spec file to compile and link the mysql module directly into the Exim binary, instead of making it a loadable module. I do not know why this global variable is not visible to the mysql loadable module on Amazon servers because it is visible on every other architecture I've ever built Exim on.
My first hunch is it has something to do with the gcc version and how it handles optimization flags. But that is not supported by any evidence or facts, it's just a hunch.