mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-16 11:57:39 -05:00
Add/update server startup scripts
This commit is contained in:
parent
7126ccf569
commit
11534f4cee
8 changed files with 106 additions and 57 deletions
31
tests/data/slapd2.conf
Normal file
31
tests/data/slapd2.conf
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# $OpenLDAP$
|
||||
#
|
||||
# stand-alone slapd config -- for testing
|
||||
# with indexing
|
||||
#
|
||||
ucdata-path ./ucdata
|
||||
include ./schema/core.schema
|
||||
include ./schema/cosine.schema
|
||||
include ./schema/inetorgperson.schema
|
||||
include ./schema/openldap.schema
|
||||
include ./schema/nis.schema
|
||||
#
|
||||
pidfile ./testrun/slapd.2.pid
|
||||
argsfile ./testrun/slapd.2.args
|
||||
|
||||
modulepath ../servers/slapd/back-@BACKEND@/
|
||||
@MODULELOAD@
|
||||
|
||||
|
||||
#######################################################################
|
||||
# database definitions
|
||||
#######################################################################
|
||||
|
||||
database @BACKEND@
|
||||
suffix "o=University of Michigan,c=US"
|
||||
directory ./testrun/db.2.a
|
||||
rootdn "cn=Manager,o=University of Michigan,c=US"
|
||||
rootpw secret
|
||||
index objectClass eq
|
||||
index cn,sn,uid pres,eq,sub
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ fi
|
|||
CLEAN=no
|
||||
WAIT=0
|
||||
KILLSERVERS=yes
|
||||
PRESERVE=no
|
||||
PRESERVE=${PRESERVE-no}
|
||||
USERDATA=no
|
||||
|
||||
while test $# -gt 0 ; do
|
||||
|
|
@ -114,7 +114,7 @@ if test -d testrun ; then
|
|||
if test $PRESERVE = no ; then
|
||||
echo "Cleaning up test run directory leftover from previous run."
|
||||
/bin/rm -rf testrun
|
||||
else
|
||||
elif test $PRESERVE = yes ; then
|
||||
echo "Cleaning up only database directories leftover from previous run."
|
||||
/bin/rm -rf testrun/db.*
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -19,11 +19,8 @@ DBDIR4=$TESTDIR/db.4.a
|
|||
DBDIR5=$TESTDIR/db.5.a
|
||||
DBDIR6=$TESTDIR/db.6.a
|
||||
|
||||
DBDIR=./test-db
|
||||
CACHEDIR=./test-db2
|
||||
REPLDIR=./test-repl
|
||||
|
||||
CONF=$DATADIR/slapd.conf
|
||||
CONFTWO=$DATADIR/slapd2.conf
|
||||
MCONF=$DATADIR/slapd-master.conf
|
||||
PWCONF=$DATADIR/slapd-pw.conf
|
||||
ACLCONF=$DATADIR/slapd-acl.conf
|
||||
|
|
|
|||
|
|
@ -1,23 +1,10 @@
|
|||
#! /bin/sh
|
||||
# $OpenLDAP$
|
||||
|
||||
SRCDIR="."
|
||||
if test $# -ge 1 ; then
|
||||
SRCDIR=$1; shift
|
||||
fi
|
||||
BACKEND=bdb
|
||||
if test $# -ge 1 ; then
|
||||
BACKEND=$1; shift
|
||||
fi
|
||||
|
||||
echo "running defines.sh"
|
||||
. $SRCDIR/scripts/defines.sh
|
||||
|
||||
echo "Datadir is $DATADIR"
|
||||
|
||||
echo "Cleaning up in $DBDIR..."
|
||||
|
||||
rm -f $DBDIR/[!C]*
|
||||
mkdir -p $TESTDIR $DBDIR1
|
||||
|
||||
echo "Running slapadd to build slapd database..."
|
||||
. $CONFFILTER $BACKEND < $CONF > $ADDCONF
|
||||
|
|
@ -28,14 +15,14 @@ if test $RC != 0 ; then
|
|||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Starting slapd on TCP/IP port $PORT..."
|
||||
. $CONFFILTER $BACKEND < $CONF > $DBCONF
|
||||
$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
|
||||
echo "Starting slapd on TCP/IP port $PORT1..."
|
||||
. $CONFFILTER $BACKEND < $CONF > $CONF1
|
||||
$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
|
||||
PID=$!
|
||||
|
||||
echo "Using ldapsearch to retrieve all the entries..."
|
||||
for i in 0 1 2 3 4 5; do
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT > $SEARCHOUT 2>&1
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC = 1 ; then
|
||||
echo "Waiting 5 seconds for slapd to start..."
|
||||
|
|
@ -43,8 +30,6 @@ for i in 0 1 2 3 4 5; do
|
|||
fi
|
||||
done
|
||||
|
||||
# kill -HUP $PID
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
exit $RC
|
||||
|
|
@ -62,7 +47,5 @@ if test $? != 0 ; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo ">>>>> Master (pid=$PID) started"
|
||||
|
||||
|
||||
echo ">>>>> Server1 (pid=$PID) started"
|
||||
exit 0
|
||||
|
|
@ -1,23 +1,10 @@
|
|||
#! /bin/sh
|
||||
# $OpenLDAP$
|
||||
|
||||
SRCDIR="."
|
||||
if test $# -ge 1 ; then
|
||||
SRCDIR=$1; shift
|
||||
fi
|
||||
BACKEND=bdb
|
||||
if test $# -ge 1 ; then
|
||||
BACKEND=$1; shift
|
||||
fi
|
||||
|
||||
echo "running defines.sh"
|
||||
. $SRCDIR/scripts/defines.sh
|
||||
|
||||
echo "Datadir is $DATADIR"
|
||||
|
||||
echo "Cleaning up in $DBDIR..."
|
||||
|
||||
rm -f $DBDIR/[!C]*
|
||||
mkdir -p $TESTDIR $DBDIR1
|
||||
|
||||
echo "Running slapadd to build slapd database..."
|
||||
. $CONFFILTER $BACKEND < $CONF > $ADDCONF
|
||||
|
|
@ -28,14 +15,14 @@ if test $RC != 0 ; then
|
|||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Starting slapd on TCP/IP port $PORT..."
|
||||
. $CONFFILTER $BACKEND < $CONF > $DBCONF
|
||||
$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING >> /dev/null 2>&1 &
|
||||
echo "Starting slapd on TCP/IP port $PORT1..."
|
||||
. $CONFFILTER $BACKEND < $CONF > $CONF1
|
||||
$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING >> /dev/null 2>&1 &
|
||||
PID=$!
|
||||
|
||||
echo "Using ldapsearch to retrieve all the entries..."
|
||||
for i in 0 1 2 3 4 5; do
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT > $SEARCHOUT 2>&1
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC = 1 ; then
|
||||
echo "Waiting 5 seconds for slapd to start..."
|
||||
|
|
@ -43,8 +30,6 @@ for i in 0 1 2 3 4 5; do
|
|||
fi
|
||||
done
|
||||
|
||||
# kill -HUP $PID
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
exit $RC
|
||||
|
|
@ -62,7 +47,5 @@ if test $? != 0 ; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo ">>>>> Master (pid=$PID) started"
|
||||
|
||||
|
||||
echo ">>>>> Server1 (pid=$PID) started"
|
||||
exit 0
|
||||
30
tests/scripts/start-server2
Executable file
30
tests/scripts/start-server2
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#! /bin/sh
|
||||
# $OpenLDAP$
|
||||
|
||||
echo "running defines.sh"
|
||||
. $SRCDIR/scripts/defines.sh
|
||||
|
||||
mkdir -p $TESTDIR $DBDIR2
|
||||
|
||||
echo "Starting slapd on TCP/IP port $PORT2..."
|
||||
. $CONFFILTER $BACKEND < $CONFTWO > $CONF2
|
||||
$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
|
||||
PID=$!
|
||||
|
||||
echo "Using ldapsearch to retrieve all the entries..."
|
||||
for i in 0 1 2 3 4 5; do
|
||||
$LDAPSEARCH -S "" -b "" -s base -h $LOCALHOST -p $PORT2 > $SERVER2OUT 2>&1
|
||||
RC=$?
|
||||
if test $RC = 1 ; then
|
||||
echo "Waiting 5 seconds for slapd to start..."
|
||||
sleep 5
|
||||
fi
|
||||
done
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo ">>>>> Server2 (pid=$PID) started"
|
||||
exit 0
|
||||
30
tests/scripts/start-server2-nolog
Executable file
30
tests/scripts/start-server2-nolog
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#! /bin/sh
|
||||
# $OpenLDAP$
|
||||
|
||||
echo "running defines.sh"
|
||||
. $SRCDIR/scripts/defines.sh
|
||||
|
||||
mkdir -p $TESTDIR $DBDIR2
|
||||
|
||||
echo "Starting slapd on TCP/IP port $PORT2..."
|
||||
. $CONFFILTER $BACKEND < $CONFTWO > $CONF2
|
||||
$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > /dev/null 2>&1 &
|
||||
PID=$!
|
||||
|
||||
echo "Using ldapsearch to retrieve all the entries..."
|
||||
for i in 0 1 2 3 4 5; do
|
||||
$LDAPSEARCH -S "" -b "" -s base -h $LOCALHOST -p $PORT2 > $SERVER2OUT 2>&1
|
||||
RC=$?
|
||||
if test $RC = 1 ; then
|
||||
echo "Waiting 5 seconds for slapd to start..."
|
||||
sleep 5
|
||||
fi
|
||||
done
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo ">>>>> Server2 (pid=$PID) started"
|
||||
exit 0
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Strip attribute from LDIF
|
||||
#
|
||||
awk '/^'$1'/ {getline; while (substr($0,1,1) == " ") getline;} /.*/ {print $0}'
|
||||
Loading…
Reference in a new issue