aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2012-01-13 15:36:21 +0100
committerRaimo Niskanen <[email protected]>2012-01-13 15:36:21 +0100
commitf3675ad3cbb3915b450311b202bea2118fca3d37 (patch)
treea2f398bf40ee4bc7d55490de473b94c39862bb67
parentc6d37ba58c505ead46a3e939b3d38236dbd20aa5 (diff)
parent9f8fe0c0ad04f8acb9b8b8ad10c328df2e24f5ad (diff)
downloadotp-f3675ad3cbb3915b450311b202bea2118fca3d37.tar.gz
otp-f3675ad3cbb3915b450311b202bea2118fca3d37.tar.bz2
otp-f3675ad3cbb3915b450311b202bea2118fca3d37.zip
Merge branch 'raimo/opu-fixes' into maint-r15
* raimo/opu-fixes: inet_res_SUITE: Improve portability of run-named inet_res_SUITE: Go back to old way to kill test name server
-rwxr-xr-xlib/kernel/test/inet_res_SUITE_data/run-named21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/kernel/test/inet_res_SUITE_data/run-named b/lib/kernel/test/inet_res_SUITE_data/run-named
index eeca680ab5..211d2c7af7 100755
--- a/lib/kernel/test/inet_res_SUITE_data/run-named
+++ b/lib/kernel/test/inet_res_SUITE_data/run-named
@@ -2,7 +2,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2009-2011. All Rights Reserved.
+## Copyright Ericsson AB 2009-2012. All Rights Reserved.
##
## The contents of this file are subject to the Erlang Public License,
## Version 1.1, (the "License"); you may not use this file except in
@@ -47,7 +47,6 @@ CONF_FILE=named.conf
INC_FILE=named_inc.conf
PID_FILE=named.pid
LOG_FILE=named.log
-EXIT_FILE=named.exit
error () {
r=$?
@@ -150,7 +149,6 @@ cat >>"$CONF_FILE" <<-CONF_FILE
( cd "$SRCDIR" && ls -1 ) | while read f; do
cp -fp "$SRCDIR/$f" .
done
-rm -f "$EXIT_FILE"
# Start nameserver
echo "Cwd: `pwd`"
@@ -158,19 +156,20 @@ echo "Nameserver: $NAMED_VER"
echo "Port: $2"
echo "ZoneDir: $3"
echo "Command: $NAMED $NAMED_FG -c $CONF_FILE"
-($NAMED $NAMED_FG -c "$CONF_FILE" >"$LOG_FILE" 2>&1 </dev/null; \
- echo "$?" >"$EXIT_FILE")&
+$NAMED $NAMED_FG -c "$CONF_FILE" >"$LOG_FILE" 2>&1 </dev/null &
NAMED_PID=$!
-trap "kill -TERM $NAMED_PID >/dev/null 2>&1; wait $NAMED_PID >/dev/null 2>&1" \
+echo "Pid: $NAMED_PID"
+trap "kill $NAMED_PID >/dev/null 2>&1; wait $NAMED_PID >/dev/null 2>&1" \
0 1 2 3 15
+
sleep 5 # Give name server time to load its zone files
-if [ -f "$EXIT_FILE" ]; then
- ERROR="`cat "$EXIT_FILE"`"
- (exit "$ERROR")& error "$NAMED returned $ERROR on start"
-else
+
+if ps -p $NAMED_PID >/dev/null 2>&1 || ps p $NAMED_PID >/dev/null 2>&1; then
echo "Running: Enter \`\`quit'' to terminate nameserver[$NAMED_PID]..."
while read LINE; do
test :"$LINE" = :'quit' && break
done
+ echo "Closing: Terminating nameserver..."
+else
+ error "$NAMED failed to start"
fi
-echo "Closing: Terminating nameserver..."