File: slapd-init.in

package info (click to toggle)
heimdal 1.6~git20120403%2Bdfsg1-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 34,428 kB
  • sloc: ansic: 338,234; sh: 7,993; makefile: 4,671; yacc: 3,036; perl: 1,888; python: 748; lex: 731; awk: 465; java: 119; asm: 30; lisp: 29
file content (39 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh 
# $Id$

srcdir=@srcdir@

rm -rf db schema
mkdir db

# kill of old slapd if running
sh ${srcdir}/slapd-stop > /dev/null

SCHEMA_NEEDED="hdb core nis cosine inetorgperson openldap samba"

SCHEMA_PATHS="${srcdir}/../../lib/hdb ${srcdir} /etc/ldap/schema /etc/openldap/schema /private/etc/openldap/schema /usr/share/openldap/schema"

test -d schema || mkdir schema

# setup needed schema files
for f in $SCHEMA_NEEDED; do
    if [ ! -r schema/$f.schema ]; then
	for d in $SCHEMA_PATHS ; do
	    if [ -r $d/$f.schema ] ; then
		cp $d/$f.schema schema/$f.schema
		continue 2
	    fi
	done
	echo "SKIPPING TESTS: you need the following schema file: $f.schema"
	exit 1
    fi
done

touch modules.conf || exit 1

slapadd -d 0 -f ${srcdir}/slapd.conf < ${srcdir}/init.ldif || exit 0

echo "starting slapd"
slapd -d0 -f ${srcdir}/slapd.conf -h ldapi://.%2Fldap-socket &

sleep 4