Ldap – FreeBSD: problem with Postfix after updating LDAP

freebsdldappostfix

At the server I installed openldap-server, at this computer open-ldap client has already been installed. Version of openldap-client (2.4.16) was older then new openldap-server (2.4.21) and the version of client has updated too. OpenLDAP-client works with postfix on this server and after all updates postfix cann't start again. The error when postfix stop|start is:

/libexec/ld-elf.so.1: Shared object
"libldap-2.4.so.6" not found, required
by "postfix"

At the category with libraries is libldap-2.4.so.7, but libldap-2.4.so.6 is removed from the server. When I want to deinstall curently version of openldap-client, system write

===>  Deinstalling for net/openldap24-client 

O.K., but when I start "make install" system write:
===>  Installing for openldap-sasl-client-2.4.23
===>   openldap-sasl-client-2.4.23 depends on shared library: sasl2.2 - found
===>   Generating temporary packing list
===>  Checking if net/openldap24-client already installed
===>   An older version of net/openldap24-client is already installed (openldap-client-2.4.21)
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of net/openldap24-client
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/net/openldap24-client.
*** Error code 1

Stop in /usr/ports/net/openldap24-client.

Updating of ports doesn't help, and postfix writes error:

/libexec/ld-elf.so.1: Shared object
"libldap-2.4.so.6" not found, required
by "postfix"

Best Answer

You upgraded your OpenLDAP client, which deleted the old version of the shared library. Postfix was built and linked against that old version of the shared library, and since it no longer exists Postfix can't start.

Re-compile postfix (which will cause it to link against the new version of the library) and this problem will go away.

In the future you can avoid problems like this by using portupgrade (check out the -r flag, which will recursively re-build packages that depend on the one being upgraded).