LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-09-2006, 12:06 AM   #1
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 40
Why so many versions of Berkeley db?


Why does slack come with 3 versions of Berkeley db? It has db3-3.3.11 , db31-3.1.17 , and db4-4.2.52 .

I thinks it's screwing up my testing of openldap. I installed openldap package i got from linuxpackages.net.

Very basic and minimual slapd.conf file.
Code:
include                         /etc/openldap/schema/core.schema
include                         /etc/openldap/schema/cosine.schema
include                         /etc/openldap/schema/inetorgperson.schema

loglevel                        296
pidfile                         /var/run/slapd.pid
argsfile                        /var/run/slapd.args

password-hash                   {SSHA}

database                        bdb
suffix                          "dc=hopto,dc=org"
rootdn                          "cn=Manager,dc=hopto,dc=org"
rootpw                          {SSHA}QxZTzC3ZAYiGtpoOp+J4GkrM14XU3NC8
directory                       /var/ldap/hopto.org
mode                            0600
index           objectClass     eq
index           cn,sn,mail      pres,eq
cachesize                       2000
access to *
 by * read
I can start slapd, but the I can't kill it, even with -sigkill.
Tried:
Code:
kill -INT `cat /var/run/slapd.pid`
kill -s sigkill `pidof slapd`
killall slapd
Have to reboot to stop it. Then if I run a db_recover, I get an error that the logfile is of an unsupported version.

So my question is could the different versions of db that come stock with slack be messing me up here?

If not, any ideas would be helpful, as I'm new to openldap.

Last edited by WindowBreaker; 02-09-2006 at 12:12 AM.
 
Old 02-09-2006, 03:52 AM   #2
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Original Poster
Rep: Reputation: 40
*SOLVED*

Solution:
1. Uninstall all 3 versions of Berkeley db that ship with slackware.
2. Configure/Compile/Install Berkeley db from source.
3. Configure/Compile/Install OpenLDAP from source.

Commands that did the magic:
Code:
## Remove all 3 bdb packages
removepkg db3-3.3.11-i486-4
removepkg db31-3.1.17-i486-1
removepkg db4-4.2.52-i486-2
## Download/configure/compile/install Berkeley db
cd /usr/local/src
wget http://downloads.sleepycat.com/db-4.4.20.tar.gz
tar xzf db-4.4.20.tar.gz
cd db-4.4.20/build_unix
../dist/configure --prefix=/usr/local/
make
make install
## Download/configure/compile/install openldap
wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-stable/openldap-stable-20060127.tgz
tar xzf openldap-stable-20060127.tgz
cd openldap-2.3.19
./configure --enable-wrappers
make depend
make
make install
To start OpenLDAP:
Code:
/usr/local/libexec/slapd
To stop OpenLDAP:
Code:
kill -HUP `cat /var/run/slapd.pid`
I really hope this saves other Slackers some time - it sure was a pain to figure out.

BTW: Below is the /etc/rc.d/rc.openldap script I wrote to control it all.

Code:
# /etc/rc.d/rc.openldap
if [ $# -eq 0 ]; then
 echo "Usage: $0: (start|stop|restart)"
 exit 1
fi

start_ldap() {
echo "Starting OpenLDAP."
echo "/usr/local/libexec/slapd"
/usr/local/libexec/slapd
sleep 1
}

stop_ldap() {
echo "Stopping OpenLDAP"
LDAPPID="$(pidof slapd|sed 's/ /\n/g'|sort -n|head -n1)"
if [ -z $LDAPPID ]; then
 echo "slapd not running"
 exit 1
else
 echo "kill -INT $LDAPPID"
 kill -INT $LDAPPID
 sleep 1
fi
}

case $1 in
 start )        start_ldap      ;;
 stop )         stop_ldap       ;;
 restart )      stop_ldap
                start_ldap      ;;
 * ) echo "Usage: $0: (start|stop|restart)"     ;;
esac

exit 0
Cheers

Last edited by WindowBreaker; 02-09-2006 at 04:17 AM.
 
Old 02-09-2006, 04:23 AM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Rep: Reputation: 36
Thanks much for sharing this with the community - it will for sure save a lot of us a lot of time.

Unless there's a good reason for Slackware to include all these version, maybe you should send a copy of this to Patrick Volkerding too for possible inclusion in future Slackware releases?

-Y1
 
Old 02-09-2006, 05:04 AM   #4
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Original Poster
Rep: Reputation: 40
Patrick is a linux genius compared to me. I'm sure he includes them for compatibility reasons. I'm also fairly sure there was a way to make openldap work with one of those 3, I just couldn't make it happen. Recompiling worked for me, so that's what I did.
 
Old 02-09-2006, 05:39 AM   #5
PDock
Member
 
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189

Rep: Reputation: 37
Believe the following works with Pats db4 stock package.

For openldap configure do
Code:
CFLAGS="$SLKCFLAGS" CPPFLAGS=-I/usr/include/db4 \
./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --libexecdir=/usr/sbin \
  --localstatedir=/var \
  --enable-modules \
  --enable-wrappers \
  --with-cyrus-sasl \
  $ARCH-slackware-linux
SLKCFLAGS is standard in any slackbuild script
hope this helps
 
Old 02-12-2006, 03:20 AM   #6
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
pat dealed with it in slackware-current:
Quote:
l/db4-4.4.20-i486-1.tgz: Upgraded to Berkeley DB 4.4.20. This will
require rebuilding any databases that use the older spec as things
are recompiled to use this, and I'm planning to do that whereever
possible. Just be glad I don't do this with every new BDB release
like I used to. :-)
.............................................
.............................................
# We'll see if we can get away with a mass removal of old Berkeley DB
# cruft. Yes, I know this will be painful, but it's not my fault that
# BDB does not stay compatible with itself. This mess had to be cleaned
# up sometime, and in preparation for a .0 release seems as good as any.
pasture/db3-3.3.11-i486-4.tgz: Moved to /pasture.
pasture/db31-3.1.17-i486-1.tgz: Moved to /pasture.
pasture/db4-4.1.25-i386-1.tgz: Moved to /pasture.
pasture/db4-4.2.52-i486-2.tgz: Moved to /pasture.
 
Old 02-12-2006, 01:54 PM   #7
irpstrcr
Member
 
Registered: Mar 2005
Location: LAX
Distribution: Slackware
Posts: 40

Rep: Reputation: 15
Quote:
BTW: Below is the /etc/rc.d/rc.openldap script I wrote to control it all.
If you are using the LDAP to store your login info you will want todo a db_recover and re-index (the re-index is optinal but it will speed up some of the transactions) each time you start slapd from the rc script, aswell as make sure the LDAP is BEFORE just about everything else in rc.inet2

This will keep you from pulling your hair out waiting for your login to be authenticated after a ungracefull shutdown.
 
Old 02-13-2006, 01:05 PM   #8
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Original Poster
Rep: Reputation: 40
I'm not using it for authentication. . . yet. Thanks for the good tip though, I'll definitely try it out.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
./configure and Berkeley DB error jCarlson917 Linux - Software 2 01-28-2006 01:29 AM
Berkeley db upgrade Dankles Slackware 1 09-26-2005 04:05 PM
Berkeley DB aesthete Linux - Software 1 02-12-2005 10:07 AM
berkeley problem hariiyer Linux - Software 2 12-22-2004 11:49 PM
Perl and Berkeley db zolley Linux - Newbie 0 06-07-2004 06:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration