start.sh revision d0dc01dd9de4c90e0adb01c3e8a51d74bc3d3559
#
# Copyright (C) 2000, 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: start.sh,v 1.33 2001/01/17 20:53:40 bwelling Exp $
#
# Start name servers for running system tests.
#
portup=0
testloop=0
while [ $portup = 0 ]
do
then
portup=1
else
echo "I:Couldn't bind to socket (yet)"
sleep 2
if [ $testloop = 5 ]; then
echo "$0: could not bind to server addresses, still running?"
echo "I:server sockets not available"
echo "R:FAIL"
exit 1
fi
fi
done
cd $1
do
(
cd $d
if test -f namedopts
then
else
opts=""
fi
$NAMED $opts -c named.conf -d 99 -g >named.run 2>&1 &
x=1
while test ! -f named.pid
do
x=`expr $x + 1`
if [ $x = 15 ]; then
echo "I:Couldn't start server $d"
echo "R:FAIL"
cd ../..
exit 1
fi
done
) || exit 1
done
do
(
if test ! -d $d
then
break
fi
cd $d
rm -f lwresd.run &&
if test -f lwresd.pid
then
then
exit 1
else
rm -f lwresd.pid
fi
fi
$LWRESD -C resolv.conf -d 99 -g -i lwresd.pid -P 9210 -p 5300 > lwresd.run 2>&1 &
x=1
while test ! -f lwresd.pid
do
x=`expr $x + 1`
if [ $x = 5 ]; then
echo "I:Couldn't start lwresd $d"
exit 1
fi
done
) || exit 1
done
do
(
if test ! -d $d
then
break
fi
cd $d
if test -f ans.pid
then
then
exit 1
else
fi
fi
x=1
while test ! -f ans.pid
do
x=`expr $x + 1`
if [ $x = 5 ]; then
echo "I:Couldn't start ans $d"
exit 1
fi
done
) || exit 1
done
# Make sure all of the servers are up.
status=0
do
try=0
while true
do
then
break
fi
if [ $try = 30 ]; then
cd ..
echo "I:no response from $d"
echo "R:FAIL"
exit 1
fi
sleep 2
done
done