LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Help installing openldap (https://www.linuxquestions.org/questions/linux-networking-3/help-installing-openldap-413301/)

WindowBreaker 02-09-2006 12:22 AM

Help installing openldap
 
I'm having trouble getting openldap working on slackware 10.2.

I installed the package from linuxpackages.net, and have a 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

I have to reboot to stop it.

Maybe I'm wrong, but I thought a INT signal to the master slapd process should cause it to clean up and terminate.

I'm thinking I must be doing something wrong. If you know what, please advise. Or if you know of a better way of getting a basic openldap working on slackware, let me know.

Thanks

WindowBreaker 02-09-2006 03:18 AM

*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.
Usage: /etc/rc.d/rc.openldap (start|stop|restart)

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


All times are GMT -5. The time now is 05:18 AM.