Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
  • Loading branch information
RaimoNiskanen committed Dec 22, 2011
2 parents f8afba0 + 8769a84 commit 2888de6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/kernel/test/inet_res_SUITE_data/run-named
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ CONF_FILE=named.conf
INC_FILE=named_inc.conf INC_FILE=named_inc.conf
PID_FILE=named.pid PID_FILE=named.pid
LOG_FILE=named.log LOG_FILE=named.log
EXIT_FILE=named.exit


error () { error () {
r=$? r=$?
Expand Down Expand Up @@ -150,27 +149,27 @@ cat >>"$CONF_FILE" <<-CONF_FILE
( cd "$SRCDIR" && ls -1 ) | while read f; do ( cd "$SRCDIR" && ls -1 ) | while read f; do
cp -fp "$SRCDIR/$f" . cp -fp "$SRCDIR/$f" .
done done
rm -f "$EXIT_FILE"


# Start nameserver # Start nameserver
echo "Cwd: `pwd`" echo "Cwd: `pwd`"
echo "Nameserver: $NAMED_VER" echo "Nameserver: $NAMED_VER"
echo "Port: $2" echo "Port: $2"
echo "ZoneDir: $3" echo "ZoneDir: $3"
echo "Command: $NAMED $NAMED_FG -c $CONF_FILE" echo "Command: $NAMED $NAMED_FG -c $CONF_FILE"
($NAMED $NAMED_FG -c "$CONF_FILE" >"$LOG_FILE" 2>&1 </dev/null; \ $NAMED $NAMED_FG -c "$CONF_FILE" >"$LOG_FILE" 2>&1 </dev/null &
echo "$?" >"$EXIT_FILE")&
NAMED_PID=$! NAMED_PID=$!
echo "Pid: $NAMED_PID"
trap "kill -TERM $NAMED_PID >/dev/null 2>&1; wait $NAMED_PID >/dev/null 2>&1" \ trap "kill -TERM $NAMED_PID >/dev/null 2>&1; wait $NAMED_PID >/dev/null 2>&1" \
0 1 2 3 15 0 1 2 3 15

sleep 5 # Give name server time to load its zone files sleep 5 # Give name server time to load its zone files
if [ -f "$EXIT_FILE" ]; then
ERROR="`cat "$EXIT_FILE"`" if ps p $NAMED_PID; then
(exit "$ERROR")& error "$NAMED returned $ERROR on start"
else
echo "Running: Enter \`\`quit'' to terminate nameserver[$NAMED_PID]..." echo "Running: Enter \`\`quit'' to terminate nameserver[$NAMED_PID]..."
while read LINE; do while read LINE; do
test :"$LINE" = :'quit' && break test :"$LINE" = :'quit' && break
done done
else
wait $NAMED_PID; error "$NAMED failed to start"
fi fi
echo "Closing: Terminating nameserver..." echo "Closing: Terminating nameserver..."

0 comments on commit 2888de6

Please sign in to comment.