xref: /netbsd-src/external/bsd/openldap/dist/tests/scripts/start-server2 (revision e670fd5c413e99c2f6a37901bb21c537fcd322d2)
12de962bdSlukem#! /bin/sh
2d11b170bStron# $OpenLDAP$
32de962bdSlukem## This work is part of OpenLDAP Software <http://www.openldap.org/>.
42de962bdSlukem##
5*e670fd5cSchristos## Copyright 1998-2021 The OpenLDAP Foundation.
62de962bdSlukem## All rights reserved.
72de962bdSlukem##
82de962bdSlukem## Redistribution and use in source and binary forms, with or without
92de962bdSlukem## modification, are permitted only as authorized by the OpenLDAP
102de962bdSlukem## Public License.
112de962bdSlukem##
122de962bdSlukem## A copy of this license is available in the file LICENSE in the
132de962bdSlukem## top-level directory of the distribution or, alternatively, at
142de962bdSlukem## <http://www.OpenLDAP.org/license.html>.
152de962bdSlukem
162de962bdSlukemecho "running defines.sh"
172de962bdSlukem. $SRCDIR/scripts/defines.sh
182de962bdSlukem
192de962bdSlukemmkdir -p $TESTDIR $DBDIR2
202de962bdSlukem
212de962bdSlukemecho "Starting slapd on TCP/IP port $PORT2..."
222de962bdSlukem. $CONFFILTER $BACKEND < $CONFTWO > $CONF2
23*e670fd5cSchristos$SLAPD -f $CONF2 -h $URI2 -d $LVL > $LOG2 2>&1 &
242de962bdSlukemPID=$!
252de962bdSlukem
262de962bdSlukemecho "Using ldapsearch to retrieve all the entries..."
272de962bdSlukemfor i in 0 1 2 3 4 5; do
28*e670fd5cSchristos	$LDAPSEARCH -S "" -b "" -s base -H $URI2 > $SERVER2OUT 2>&1
292de962bdSlukem	RC=$?
302de962bdSlukem	if test $RC = 1 ; then
312de962bdSlukem		echo "Waiting 5 seconds for slapd to start..."
322de962bdSlukem		sleep 5
332de962bdSlukem	fi
342de962bdSlukemdone
352de962bdSlukem
362de962bdSlukemif test $RC != 0 ; then
372de962bdSlukem	echo "ldapsearch failed ($RC)!"
382de962bdSlukem	exit $RC
392de962bdSlukemfi
402de962bdSlukem
412de962bdSlukemecho ">>>>> Server2 (pid=$PID) started"
422de962bdSlukemexit 0
43