test debug
[heimdal.git] / tests / ldap / slapd-init.in
blobf25dce08c3002485f709ca2a1ca8ec368e21d21e
1 #!/bin/sh
2 # $Id$
4 srcdir=@srcdir@
6 rm -rf db schema
7 mkdir db
9 # kill of old slapd if running
10 sh ${srcdir}/slapd-stop > /dev/null
12 SCHEMA_NEEDED="hdb core nis cosine inetorgperson openldap samba"
14 SCHEMA_PATHS="${srcdir}/../../lib/hdb ${srcdir} /etc/ldap/schema /etc/openldap/schema /private/etc/openldap/schema /usr/share/openldap/schema"
16 test -d schema || mkdir schema
18 # setup needed schema files
19 for f in $SCHEMA_NEEDED; do
20 if [ ! -r schema/$f.schema ]; then
21 for d in $SCHEMA_PATHS ; do
22 if [ -r $d/$f.schema ] ; then
23 cp $d/$f.schema schema/$f.schema
24 continue 2
26 done
27 echo "SKIPPING TESTS: you need the following schema file: $f.schema"
28 exit 1
30 done
32 touch modules.conf || exit 1
34 slapadd -d 0 -f ${srcdir}/slapd.conf < ${srcdir}/init.ldif || exit 0
36 echo "starting slapd"
37 slapd -d0 -f ${srcdir}/slapd.conf -h ldapi://.%2Fldap-socket &
39 sleep 4