aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2011-12-22 15:49:46 +0100
committerRaimo Niskanen <[email protected]>2011-12-22 15:49:46 +0100
commit8769a849dbbb70cb92733f484b2a0e1693e97eb7 (patch)
tree655311e1cf96a7bc7f518a90eb559ea336cc4dff /lib
parentc2743754c9189e66a3a70248703118d8e61b7701 (diff)
parentfed610860ce79634e3a221a1f86e8382dee1088c (diff)
downloadotp-8769a849dbbb70cb92733f484b2a0e1693e97eb7.tar.gz
otp-8769a849dbbb70cb92733f484b2a0e1693e97eb7.tar.bz2
otp-8769a849dbbb70cb92733f484b2a0e1693e97eb7.zip
Merge branch 'raimo/opu-fixes' into maint
* raimo/opu-fixes: inet_res_SUITE: Go back to old way to kill test name server
Diffstat (limited to 'lib')
-rwxr-xr-xlib/kernel/test/inet_res_SUITE_data/run-named15
1 files changed, 7 insertions, 8 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..619e456b3f 100755
--- a/lib/kernel/test/inet_res_SUITE_data/run-named
+++ b/lib/kernel/test/inet_res_SUITE_data/run-named
@@ -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=$!
+echo "Pid: $NAMED_PID"
trap "kill -TERM $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; then
echo "Running: Enter \`\`quit'' to terminate nameserver[$NAMED_PID]..."
while read LINE; do
test :"$LINE" = :'quit' && break
done
+else
+ wait $NAMED_PID; error "$NAMED failed to start"
fi
echo "Closing: Terminating nameserver..."