Subject: pkg/35249: Sendmail fails to find libraries in /usr/pkg/lib on Linux.
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 12/13/2006 18:05:01
>Number:         35249
>Category:       pkg
>Synopsis:       Sendmail fails to find libraries in /usr/pkg/lib on Linux.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 13 18:05:01 +0000 2006
>Originator:     Loren M. Lang
>Release:        RedHat 9 Linux 2.4.20-20.9b
Alzatex, Inc.
Linux 2.4.20-20.9b #1 SMP Wed Nov 19 22:14:33 PST 2003 i686 i686 i386 GNU/Linux
I am using pkgsrc on Linux to replace parts of the Linux userland one-by-one.  Cyrus SASL, OpenSSL and OpenLDAP are installed from pkgsrc with older versions sitting under /usr and /usr/local.  The port mail/sendmail appears to install correctly, though none of the executables run due to missing libraries.  Specifically, it cannot find the ldap libraries that were installed into /usr/pkg/lib as the SONAME is different than installed under /usr/lib.

/usr/pkg/libexec/sendmail/sendmail: error while loading shared libraries: cannot open shared object file: No such file or directory

$ldd /usr/pkg/libexec/sendmail/sendmail => /usr/lib/ (0x4003a000) => /usr/local/lib/ (0x40184000) => not found => not found => not found

Looking in work/.work.log, I found no -R options to the linker or compiler.
Install newer versions of OpenLDAP, BerkeleyDB, or other libraries onto a Linux system from pkgsrc, then install Sendmail from pkgsrc with the appropriate options enabled so that it depends on them and see that the generated binaries cannot find the libraries from pkgsrc unless /usr/pkg/lib is added to /etc/ and /sbin/ldconfig is re-ran.
A work-around on Linux is to add /usr/pkg/lib to /etc/ and run /sbin/ldconfig to update the library cache.  This causes sendmail from pkgsrc to find the appropriate libraries, but, of course, causes a lot of the base system programs to change to the libraries from pkgsrc.  The correct course of action is to have sendmail linked with the appropriate -R option.