BDB Nightmare

Dominic Ijichi dom at ijichi.org
Sun Oct 24 06:21:25 EDT 2004


Quoting Akshay Kumar <akshay at cs.columbia.edu>:

> Guys,
> 
> One more problem, cyradm wont work.
> 
> [root at cyrus bin]# ./cyradm
> Can't load
>
>'/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Cyrus/IMAP/IMAP.so'
> for module Cyrus::IMAP:
> /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Cyrus/IMAP/IMAP.so:
> undefined symbol: db_version at
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229.

so.. ldd -r
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Cyrus/IMAP/IMAP.so
you'll either get missing symbols and/or missing lib.  which is it?
otherwise, it looks like the perl mods are correctly installed.

if you built these while you had broken db libs, it might be that subsequent
installs sees them and doesnt want to overwrite them, possibly?  in which case
delete them by hand and try doing 'make install' again.

>  at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cyrus/IMAP/Admin.pm line
> 44
> Compilation failed in require at
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cyrus/IMAP/Admin.pm line 44.
> BEGIN failed--compilation aborted at
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cyrus/IMAP/Admin.pm line 44.
> Compilation failed in require at
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cyrus/IMAP/Shell.pm line 60.
> BEGIN failed--compilation aborted at
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cyrus/IMAP/Shell.pm line 60.
> Compilation failed in require.
> BEGIN failed--compilation aborted.
> 
> On Sat, 23 Oct 2004, Akshay Kumar wrote:
> 
> > Fixed.
> >
> > Like Dominic pointed out bdb was broken.
> >
> > Making it with
> >
> > 	make LIBSO_LIBS="-lpthread" LIBXSO_LIBS="-lpthread"

ah, thats it.  thanks for reporting back the fix, this will probably help lots
of other redhat users who are scratching their heads over compilation :)

> > fixed it.
> >
> > So now finally the following are working in /spare/local:
> >
> > bdb-4.2.52, SASL 2.1.19, Openldap 2.2.17, Sendmail 8.13.1, Cyrus 2.2.8,
> > apache and silkymail.
> >
> > Believe it or not there was a good reason for putting all of them in a
> > non-standard location. Namely the rdist setup at work overwrites
> > everything that is not precioused everyday at 4am. Updating the master
> > would have broken a lot of other mail servers that were not built with
> > SASLv2 and using old bdb and sendmail-8.12. Also sasl was not built with
> > ldap.

on redhat you kinda have to build all this outside the main tree, as all their
default stuff is either ancient or broken.  i've recently tried various other
distros and realise what a poor job redhat has been doing...

dom

> > I am going to wait for rhel as 4 till I build a new master, till then this
> > should work fine.
> >
> >
> > Thanks and Best,
> > Akshay
> >
> > On Sat, 23 Oct 2004, Dominic Ijichi wrote:
> >
> > > Quoting Akshay Kumar <akshay at cs.columbia.edu>:
> > >
> > > > Hi,
> > > >
> > > > Thanks for the reply.
> > > >
> > > > I am running Redhat 9 with updates from Progeny. I can't upgrade the OS
> > > > either.
> > >
> > > nice, lucky you :)
> > >
> > > > ldd -r /spare/local/lib/libdb-4.2.so give the following output:
> > > >
> > > >         libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
> > > >         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x55555000)
> > > > undefined symbol: pthread_condattr_setpshared
> > > > (/spare/local/lib/libdb-4.2.so)
> > > > undefined symbol: pthread_mutexattr_destroy
> > > > (/spare/local/lib/libdb-4.2.so)
> > > > undefined symbol: pthread_mutexattr_setpshared
> > > > (/spare/local/lib/libdb-4.2.so)
> > > > undefined symbol: pthread_mutexattr_init
> > > > (/spare/local/lib/libdb-4.2.so)
> > > > undefined symbol: pthread_mutex_trylock (/spare/local/lib/libdb-4.2.so)
> > >
> > > this means your berkeley db4.2 libs are broken.  try recompiling with
> -lpthread.
> > >    i think you can either try LIBS='-lpthread' ./configure, or run
> configure and
> > > amend resulting Makefile LIBS line with -lpthread.  iirc, i had similar
> problems
> > > when redhat introduced ntpl thread libs out of the blue.
> > >
> > > > I also have the following rpms of an older version:
> > > >
> > > > db4-4.0.14-20
> > > > db4-devel-4.0.14-20
> > >
> > > ok, theoretically these shouldn't get in the way.
> > >
> > > > I can't uninstall them as I need this for other dependencies which is
> why
> > > > I am using /spare/local.
> > >
> > > fair enough.  it is possible, although particularly with berkeley db4 not
> > > recommended, to force remove the rpms with 'rpm -e db4 db4-devel
> --nodeps' and
> > > drop the /spare/local/lib into ld.so.conf to fill in the gaps.  i've done
> this
> > > numerous times on redhat with ssl and ldap where the libs dont vary quite
> as
> > > much from minor version to minor version, unfortunately with berkeley
> it's
> > > extremely sensitive and thus usually a really, really bad idea.
> > >
> > > > adding "LDFLAGS=-L/spare/local/lib -R/spare/local/lib" doesnt help
> either.
> > >
> > > hmm, this is more for solaris, i dont think it does much on linux.
> > >
> > > > /spare/local/lib is the top entry in ld.so.conf and I then ran
> ldconfig.
> > >
> > > unfortunately ldconfig silently inserts the 'system library paths' -ie
> /lib,
> > > /usr/lib before everything else.  i dont know how to change this,
> although would
> > > love to know how.
> > >
> > > > Everything else picks up the correct version, SASL, Sendmail, Openldap.
> > >
> > > as you're specifying --bdb-libdir and its ignoring it, i would recommend
> looking
> > > in the config.log for the test for this switch.  i'd hazard a guess and
> say it's
> > > failing because of the broken libraries, and thus falling back to the
> system db4
> > > libs it finds in /usr/lib.  fix these broken libs in /spare/local/lib and
> i
> > > suspect all will be well.
> > >
> > > good luck :)  let us know if this helps, i'm sure i'm not the only one in
> the
> > > past who has come up against this problem.
> > >
> > > dom
> > >
> > > >
> > > > ldd ./sendmail
> > > >         libsasl2.so.2 => /spare/local/lib/libsasl2.so.2 (0x2aad9000)
> > > >         libdb-4.2.so => /spare/local/lib/libdb-4.2.so (0x2aaed000)
> > > >         libpthread.so.0 => /lib/tls/libpthread.so.0 (0x2ab94000)
> > > >         libssl.so.4 => /lib/libssl.so.4 (0x2aba2000)
> > > >         libcrypto.so.4 => /lib/libcrypto.so.4 (0x2abd7000)
> > > >         libresolv.so.2 => /lib/libresolv.so.2 (0x2acce000)
> > > >         libcrypt.so.1 => /lib/libcrypt.so.1 (0x2ace0000)
> > > >         libnsl.so.1 => /lib/libnsl.so.1 (0x2ad0e000)
> > > >         libdl.so.2 => /lib/libdl.so.2 (0x2ad23000)
> > > >         libldap-2.2.so.7 => /spare/local/lib/libldap-2.2.so.7
> (0x2ad27000)
> > > >         liblber-2.2.so.7 => /spare/local/lib/liblber-2.2.so.7
> (0x2ad54000)
> > > >         libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
> > > >         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaab000)
> > > >         libgssapi_krb5.so.2 => /usr/kerberos/lib/libgssapi_krb5.so.2
> > > > (0x2ad60000)
> > > >         libkrb5.so.3 => /usr/kerberos/lib/libkrb5.so.3 (0x2ad74000)
> > > >         libcom_err.so.3 => /usr/kerberos/lib/libcom_err.so.3
> (0x2add2000)
> > > >         libk5crypto.so.3 => /usr/kerberos/lib/libk5crypto.so.3
> > > > (0x2add4000)
> > > >         libz.so.1 => /usr/lib/libz.so.1 (0x2ade4000)
> > > >
> > > >  ldd ./slapd
> > > >         libdb-4.2.so => /spare/local/lib/libdb-4.2.so (0x2aad9000)
> > > >         libsasl2.so.2 => /spare/local/lib/libsasl2.so.2 (0x2ab81000)
> > > >         libssl.so.4 => /lib/libssl.so.4 (0x2ab94000)
> > > >         libcrypto.so.4 => /lib/libcrypto.so.4 (0x2abc9000)
> > > >         libresolv.so.2 => /lib/libresolv.so.2 (0x2acc0000)
> > > >         libpthread.so.0 => /lib/tls/libpthread.so.0 (0x2acd2000)
> > > >         libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
> > > >         libdl.so.2 => /lib/libdl.so.2 (0x2ace1000)
> > > >         libgssapi_krb5.so.2 => /usr/kerberos/lib/libgssapi_krb5.so.2
> > > > (0x2ace5000)
> > > >         libkrb5.so.3 => /usr/kerberos/lib/libkrb5.so.3 (0x2acf8000)
> > > >         libcom_err.so.3 => /usr/kerberos/lib/libcom_err.so.3
> (0x2ad56000)
> > > >         libk5crypto.so.3 => /usr/kerberos/lib/libk5crypto.so.3
> > > > (0x2ad58000)
> > > >         libz.so.1 => /usr/lib/libz.so.1 (0x2ad68000)
> > > >         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaab000)
> > > >
> > > > and say for openldap I used this:
> > > >
> > > >
> > > > env "CPPFLAGS=-I/spare/local/include -I/usr/kerberos/include"
> > > > "LDFLAGS=-L/spare/local/lib" ./configure --prefix=/spare/local
> > > > --enable-ldap --enable-bdb
> > > >
> > > >
> > > >
> > > > Its just cyrus that has a problem with it, everything else finds the
> > > > correct version.
> > > >
> > > >
> > > > Best,
> > > > Akshay
> > > >
> > > >
> > > >
> > > > On Sat, 23 Oct 2004, Dominic Ijichi wrote:
> > > >
> > > > > Quoting Akshay Kumar <akshay at cs.columbia.edu>:
> > > > >
> > > > > > Has anyone had any luck using the lastest version of BDB 4.2.52 w/
> the
> > > > > > cyrus 2.2.8?
> > > > > >
> > > > > > I compiled Berkeley DB 4.2.52. I also succesfully build sendmail,
> sasl
> > > > and
> > > > > > openldap against this version installed in /spare/local.
> > > > > > But I am having problems getting cyrus-imap to use this version.
> > > > > >
> > > > > > I tried:
> > > > > >
> > > > > > env "CPPFLAGS=-I/spare/local/include -I/usr/kerberos/include"
> > > > > > "LDFLAGS=-L/spare/local/lib" ./configure --prefix=/spare/local
> > > > > > --with-cyrus-prefix=/spare/local/cyrus --with-bdb=/spare/local
> > > > > > --with-bdb-libdir=/spare/local/lib
> > > > > > --with-bdb-incdir=/spare/local/include --with-snmp=/spare/local/lib
> > > > > >
> > > > > > make depend
> > > > > > make all CFLAGS=-O
> > > > > >
> > > > > > BDB is installed in /spare/local
> > > > > >
> > > > > > Syslog throws the following error:
> > > > > >
> > > > > > Oct 20 11:28:19 test ctl_cyrusdb[18987]: incorrect version of
> Berkeley
> > > > db:
> > > > > > compiled against 4.2.52, linked against 4.0.14
> > > > >
> > > > > hi, you dont say what OS you're using, which doesnt help much here...
> > > > >
> > > > > looks like its picking up the correct db.h but not the correct
> libdb-4.so.
> > > > if
> > > > > its linux, make sure you haven't got the db4 and db4-devel rpms
> installed,
> > > > as
> > > > > even if you put /spare/local/lib in /etc/ld.so.conf it will still
> look in
> > > > > /usr/lib first which is where the system db4 rpm throws the libs. 
> you
> > > > could try
> > > > > changing 'LDFLAGS=-L/spare/local/lib" to 'LDFLAGS=-L/spare/local/lib
> > > > > -R/spare/local/lib".  if you use LD_LIBRARY_PATH, put
> /spare/local/lib in
> > > > first,
> > > > > or at least before /usr/lib.  if you're using crle/ldconfig then i'm
> not
> > > > sure
> > > > > how you override the system lib paths, if you can at all, i usually
> > > > forcibly
> > > > > remove the system db4 rpms to eliminate any conflict,but this is not
> > > > advised
> > > > > unless you know the OS really well.
> > > > >
> > > > > oh, also make sure your libs have built correctly, do 'ldd -r
> > > > > /space/local/lib/libdb-4.2.so' and make sure you don't get any
> errors.
> > > > >
> > > > > ------------------------------------------
> > > > > This message was penned by the hand of Dom
> > > > >
> > >
> > >
> > > ------------------------------------------
> > > This message was penned by the hand of Dom
> > > ---
> > > Cyrus Home Page: http://asg.web.cmu.edu/cyrus
> > > Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
> > > List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
> > >
> > ---
> > Cyrus Home Page: http://asg.web.cmu.edu/cyrus
> > Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
> > List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
> >


------------------------------------------
This message was penned by the hand of Dom
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list