I updated from 2.4.21 to 2.4.23 in some old Fedoras and also in a CentOS 5.4.
Before compiling, I run:
export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.6/lib export CPPFLAGS="-I/usr/local//BerkeleyDB.4.6/include" export LDFLAGS="-L/usr/local/BerkeleyDB.4.6/lib"
and it compiles ok. But after installed, in 3 out 4 of the used servers, slapd doesn't start unless I execute first:
export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.6/lib
Attached, the output of ldd /usr/local/libexec/slapd, before and after running export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.6/lib. In short:
without LD_LIBRARY_PATH defined:
libdb-4.6.so => not found
with LD_LIBRARY_PATH as above:
libdb-4.6.so => /usr/local/BerkeleyDB.4.6/lib/libdb-4.6.so (0x00002b4eb2c16000)
Could you please explain me why this might be happening? Is this a bug? This issue ocurred to me in at least 3 server, but I have another CentOS 5.4, where the compilation and the install process run just fine, and I didn't need that workaround.
Thank you,
Pablo Chamorro
La informaci�n contenida en este mensaje y cualquiera de sus adjuntos es confidencial, para el uso exclusivo de la persona o entidad destinataria. Si usted ha recibido este mensaje por equivocaci�n, se le notifica que no est� autorizado para revisarlo, reenviarlo, imprimirlo, copiarlo o distribuirlo de forma parcial o total; por favor comunique el error a la persona que lo env�a y elim�nelo. Las opiniones y puntos de vista presentados en este mensaje son responsabilidad de quien firma el mensaje y no representan necesariamente la posici�n y puntos de vista de INGEOMINAS. Este mensaje de correo electr�nico ha sido analizado por el antivirus Mcafee.
Confidentiality Notice The information in this message and any attachments is confidential, it is for exclusive use of the person or entity to which it is addressed. If you have received this message in error, you are notified that you are not authorized to review, re-transmit, print out, disseminate, copy or distribute it in partial or total way; please communicate the mistake to the person who sent this message and delete it. The opinions and points of view stated in this message with responsibility by who signed the message, do not necessarily represent the opinion or point of view of INGEOMINAS. This electronic mail message was scanned by the Mcafee anti-virus.
You should embed the correct path by adding -R/usr/local/BerkeleyDB.4.6/lib to your LDFLAGS at compile time, or set LD_RUN_PATH before compiling, which works similarly.
It is unwise to leave location of BDB libraries to chance, as if you are relying on OS provided default libraries, they will frequently be wrong or will cause issues, or your newer libraries may not be found.
Linux usually only puts /usr/local/lib and other system paths such as /usr/lib etc., in the default library path.
This is not a workaround, it is just the way it works. You must make sure you provide the same libraries you compiled with, otherwise openldap may fail as it will not find libraries, or default to some system libraries which can be broken or old.
The -R option stores the library location in the executables, at runtime it will look first in this location, before it falls back to using LD_LIBRARY_PATH etc.,
Cheers Brett
On Tue, Oct 25, 2011 at 2:04 AM, Pablo Chamorro C. < pchamorro@ingeominas.gov.co> wrote:
I updated from 2.4.21 to 2.4.23 in some old Fedoras and also in a CentOS 5.4.
Before compiling, I run:
export LD_LIBRARY_PATH=/usr/local/**BerkeleyDB.4.6/lib export CPPFLAGS="-I/usr/local//**BerkeleyDB.4.6/include" export LDFLAGS="-L/usr/local/**BerkeleyDB.4.6/lib"
and it compiles ok. But after installed, in 3 out 4 of the used servers, slapd doesn't start unless I execute first:
export LD_LIBRARY_PATH=/usr/local/**BerkeleyDB.4.6/lib
Attached, the output of ldd /usr/local/libexec/slapd, before and after running export LD_LIBRARY_PATH=/usr/local/**BerkeleyDB.4.6/lib. In short:
without LD_LIBRARY_PATH defined:
libdb-4.6.so => not found
with LD_LIBRARY_PATH as above:
libdb-4.6.so => /usr/local/BerkeleyDB.4.6/lib/**libdb-4.6.so<http://libdb-4.6.so>(0x00002b4eb2c16000)
Could you please explain me why this might be happening? Is this a bug? This issue ocurred to me in at least 3 server, but I have another CentOS 5.4, where the compilation and the install process run just fine, and I didn't need that workaround.
Thank you,
Pablo Chamorro
On Sat, 29 Oct 2011, Brett @Google wrote:
You should embed the correct path by adding -R/usr/local/BerkeleyDB.4.6/lib to your LDFLAGS at compile time, or set LD_RUN_PATH before compiling, which works similarly.
It is unwise to leave location of BDB libraries to chance, as if you are relying on OS provided default libraries, they will frequently be wrong or will cause issues, or your newer libraries may not be found.
Linux usually only puts /usr/local/lib and other system paths such as /usr/lib etc., in the default library path.
This is not a workaround, it is just the way it works. You must make sure you provide the same libraries you compiled with, otherwise openldap may fail as it will not find libraries, or default to some system libraries which can be broken or old.
The -R option stores the library location in the executables, at runtime it will look first in this location, before it falls back to using LD_LIBRARY_PATH etc.,
Thank you very much! I added the -R option and it worked as you said.
Pablo Chamorro
Cheers Brett
On Tue, Oct 25, 2011 at 2:04 AM, Pablo Chamorro C. pchamorro@ingeominas.gov.co wrote: I updated from 2.4.21 to 2.4.23 in some old Fedoras and also in a CentOS 5.4.
Before compiling, I run: export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.6/lib export CPPFLAGS="-I/usr/local//BerkeleyDB.4.6/include" export LDFLAGS="-L/usr/local/BerkeleyDB.4.6/lib" and it compiles ok. But after installed, in 3 out 4 of the used servers, slapd doesn't start unless I execute first: export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.6/lib Attached, the output of ldd /usr/local/libexec/slapd, before and after running export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.6/lib. In short: without LD_LIBRARY_PATH defined: libdb-4.6.so => not found with LD_LIBRARY_PATH as above: libdb-4.6.so => /usr/local/BerkeleyDB.4.6/lib/libdb-4.6.so (0x00002b4eb2c16000) Could you please explain me why this might be happening? Is this a bug? This issue ocurred to me in at least 3 server, but I have another CentOS 5.4, where the compilation and the install process run just fine, and I didn't need that workaround. Thank you, Pablo Chamorro
The only thing that interferes with my learning is my education.
Albert Einstein
La información contenida en este mensaje y cualquiera de sus adjuntos es confidencial, para el uso exclusivo de la persona o entidad destinataria. Si usted ha recibido este mensaje por equivocación, se le notifica que no está autorizado para revisarlo, reenviarlo, imprimirlo, copiarlo o distribuirlo de forma parcial o total; por favor comunique el error a la persona que lo envía y elimínelo. Las opiniones y puntos de vista presentados en este mensaje son responsabilidad de quien firma el mensaje y no representan necesariamente la posición y puntos de vista de INGEOMINAS. Este mensaje de correo electrónico ha sido analizado por el antivirus Mcafee.
Confidentiality Notice The information in this message and any attachments is confidential, it is for exclusive use of the person or entity to which it is addressed. If you have received this message in error, you are notified that you are not authorized to review, re-transmit, print out, disseminate, copy or distribute it in partial or total way; please communicate the mistake to the person who sent this message and delete it. The opinions and points of view stated in this message with responsibility by who signed the message, do not necessarily represent the opinion or point of view of INGEOMINAS. This electronic mail message was scanned by the Mcafee anti-virus.
openldap-technical@openldap.org