From: Debian Krap Maintainers Date: Wed, 17 Apr 2013 19:30:26 +0000 (+0000) Subject: safer-timeout X-Git-Tag: archive/raspbian/6.1.6+dfsg2-4+rpi1~1^2^2^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c292f837826cdf3c0eebda22ce9d740e317a61ab;p=virtuoso-opensource.git safer-timeout Gbp-Pq: Name safer-timeout.patch --- diff --git a/appsrc/ODS-Addressbook/make_vad.sh b/appsrc/ODS-Addressbook/make_vad.sh index a4cf3ef9..cfae5deb 100755 --- a/appsrc/ODS-Addressbook/make_vad.sh +++ b/appsrc/ODS-Addressbook/make_vad.sh @@ -102,7 +102,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -113,17 +113,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-Blog/make_vad.sh b/appsrc/ODS-Blog/make_vad.sh index fe3224f2..66eb5cad 100755 --- a/appsrc/ODS-Blog/make_vad.sh +++ b/appsrc/ODS-Blog/make_vad.sh @@ -121,7 +121,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -132,17 +132,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-Bookmark/make_vad.sh b/appsrc/ODS-Bookmark/make_vad.sh index 17920ca4..a8bfbf57 100755 --- a/appsrc/ODS-Bookmark/make_vad.sh +++ b/appsrc/ODS-Bookmark/make_vad.sh @@ -106,7 +106,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -117,17 +117,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-Briefcase/make_vad.sh b/appsrc/ODS-Briefcase/make_vad.sh index 0d405634..addb930b 100755 --- a/appsrc/ODS-Briefcase/make_vad.sh +++ b/appsrc/ODS-Briefcase/make_vad.sh @@ -122,7 +122,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -133,17 +133,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-Calendar/make_vad.sh b/appsrc/ODS-Calendar/make_vad.sh index d6bb5895..3fe0c011 100755 --- a/appsrc/ODS-Calendar/make_vad.sh +++ b/appsrc/ODS-Calendar/make_vad.sh @@ -105,7 +105,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -116,17 +116,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-Community/make_vad.sh b/appsrc/ODS-Community/make_vad.sh index bd7268db..8fa55091 100755 --- a/appsrc/ODS-Community/make_vad.sh +++ b/appsrc/ODS-Community/make_vad.sh @@ -109,7 +109,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -120,17 +120,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-Discussion/make_vad.sh b/appsrc/ODS-Discussion/make_vad.sh index c7b7ac4b..fad6c536 100755 --- a/appsrc/ODS-Discussion/make_vad.sh +++ b/appsrc/ODS-Discussion/make_vad.sh @@ -119,7 +119,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting Virtuoso Server start on port $PORT..." @@ -130,17 +130,9 @@ virtuoso_start() { LOG "PASSED: Virtuoso Server successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-FeedManager/make_vad.sh b/appsrc/ODS-FeedManager/make_vad.sh index 51113264..1bc2ae2c 100755 --- a/appsrc/ODS-FeedManager/make_vad.sh +++ b/appsrc/ODS-FeedManager/make_vad.sh @@ -105,7 +105,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -116,17 +116,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-Framework/make_vad.sh b/appsrc/ODS-Framework/make_vad.sh index 2aeb4005..54046445 100755 --- a/appsrc/ODS-Framework/make_vad.sh +++ b/appsrc/ODS-Framework/make_vad.sh @@ -147,7 +147,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -158,17 +158,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-Framework/oauth/make_vad.sh b/appsrc/ODS-Framework/oauth/make_vad.sh index c7ba6744..e97a7b0a 100755 --- a/appsrc/ODS-Framework/oauth/make_vad.sh +++ b/appsrc/ODS-Framework/oauth/make_vad.sh @@ -197,7 +197,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting Virtuoso Server start on port $PORT..." @@ -208,17 +208,9 @@ virtuoso_start() { LOG "PASSED: Virtuoso Server successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } virtuoso_shutdown() { diff --git a/appsrc/ODS-Gallery/make_vad.sh b/appsrc/ODS-Gallery/make_vad.sh index 310b414d..b5ee9a4f 100755 --- a/appsrc/ODS-Gallery/make_vad.sh +++ b/appsrc/ODS-Gallery/make_vad.sh @@ -109,7 +109,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -120,17 +120,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-Polls/make_vad.sh b/appsrc/ODS-Polls/make_vad.sh index 193784ee..b2026801 100755 --- a/appsrc/ODS-Polls/make_vad.sh +++ b/appsrc/ODS-Polls/make_vad.sh @@ -104,7 +104,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -115,17 +115,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-WebMail/make_vad.sh b/appsrc/ODS-WebMail/make_vad.sh index adb11e7b..01d79a84 100755 --- a/appsrc/ODS-WebMail/make_vad.sh +++ b/appsrc/ODS-WebMail/make_vad.sh @@ -105,7 +105,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -116,17 +116,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/appsrc/ODS-Wiki/make_vad.sh b/appsrc/ODS-Wiki/make_vad.sh index e5146244..80113035 100755 --- a/appsrc/ODS-Wiki/make_vad.sh +++ b/appsrc/ODS-Wiki/make_vad.sh @@ -140,7 +140,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting Virtuoso Server start on port $PORT..." @@ -151,17 +151,9 @@ virtuoso_start() { LOG "PASSED: Virtuoso Server successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/binsrc/b3s/make_vad.sh b/binsrc/b3s/make_vad.sh index d943dfeb..a8ccba56 100755 --- a/binsrc/b3s/make_vad.sh +++ b/binsrc/b3s/make_vad.sh @@ -213,7 +213,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting Virtuoso Server start on port $PORT..." @@ -224,17 +224,9 @@ virtuoso_start() { LOG "PASSED: Virtuoso Server successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } virtuoso_shutdown() { diff --git a/binsrc/bpel/make_vad.sh b/binsrc/bpel/make_vad.sh index 28254ebd..b793b24b 100755 --- a/binsrc/bpel/make_vad.sh +++ b/binsrc/bpel/make_vad.sh @@ -263,7 +263,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting Virtuoso Server start on port $PORT..." @@ -274,17 +274,9 @@ virtuoso_start() { LOG "PASSED: Virtuoso Server successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } virtuoso_shutdown() { diff --git a/binsrc/hosting/mono/tests/tclrsrv.sh b/binsrc/hosting/mono/tests/tclrsrv.sh index 7bf3d1b8..a071aad5 100755 --- a/binsrc/hosting/mono/tests/tclrsrv.sh +++ b/binsrc/hosting/mono/tests/tclrsrv.sh @@ -221,7 +221,7 @@ START_SERVER () rm -f *.lck $SERVER +foreground -c tclr.ini $* 1>/dev/null & stat="true" - while true + for i in $(seq 1 15) do sleep 4 stat=`netstat -an | grep "[\.\:]$PORT " | grep LISTEN` @@ -231,20 +231,9 @@ START_SERVER () LOG "PASSED: Virtuoso Server successfully started on port $port" return 0 fi - - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } WAITALL () diff --git a/binsrc/isparql/make_vad.sh b/binsrc/isparql/make_vad.sh index f5da6f6f..e0865601 100755 --- a/binsrc/isparql/make_vad.sh +++ b/binsrc/isparql/make_vad.sh @@ -126,7 +126,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -137,17 +137,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/binsrc/rdf_mappers/make_vad.sh b/binsrc/rdf_mappers/make_vad.sh index 77fe9039..9129ddf0 100755 --- a/binsrc/rdf_mappers/make_vad.sh +++ b/binsrc/rdf_mappers/make_vad.sh @@ -258,7 +258,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting Virtuoso Server start on port $PORT..." @@ -269,17 +269,9 @@ virtuoso_start() { LOG "PASSED: Virtuoso Server successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } virtuoso_shutdown() { diff --git a/binsrc/samples/demo/make_vad.sh b/binsrc/samples/demo/make_vad.sh index 7854c894..32b150bd 100755 --- a/binsrc/samples/demo/make_vad.sh +++ b/binsrc/samples/demo/make_vad.sh @@ -124,7 +124,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -135,17 +135,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/binsrc/samples/demo/mkdemo.sh b/binsrc/samples/demo/mkdemo.sh index 748129f1..21ed4824 100755 --- a/binsrc/samples/demo/mkdemo.sh +++ b/binsrc/samples/demo/mkdemo.sh @@ -153,7 +153,7 @@ START_SERVER() starth=`date | cut -f 2 -d :` starts=`date | cut -f 3 -d :|cut -f 1 -d " "` - while true + for i in $(seq 1 10) do sleep 6 if (netstat -an | grep "$PORT" | grep LISTEN > /dev/null) @@ -161,19 +161,9 @@ START_SERVER() ECHO "Virtuoso server started" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done ECHO "***WARNING: Could not start Virtuoso DEMO Server within $timeout seconds" return 1 - fi - done } STOP_SERVER() diff --git a/binsrc/samples/demo/mkdoc.sh b/binsrc/samples/demo/mkdoc.sh index 3974bea9..4c44c2c2 100755 --- a/binsrc/samples/demo/mkdoc.sh +++ b/binsrc/samples/demo/mkdoc.sh @@ -174,7 +174,7 @@ START_SERVER() starth=`date | cut -f 2 -d :` starts=`date | cut -f 3 -d :|cut -f 1 -d " "` - while true + for i in $(seq 1 10) do sleep 6 if (netstat -an | grep "$PORT" | grep LISTEN > /dev/null) @@ -182,19 +182,9 @@ START_SERVER() ECHO "Virtuoso server started" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done ECHO "***WARNING: Could not start Virtuoso DOC Server within $timeout seconds" return 1 - fi - done fi } diff --git a/binsrc/samples/sparql_demo/make_vad.sh b/binsrc/samples/sparql_demo/make_vad.sh index fc5e3736..fc6327ab 100755 --- a/binsrc/samples/sparql_demo/make_vad.sh +++ b/binsrc/samples/sparql_demo/make_vad.sh @@ -123,7 +123,7 @@ virtuoso_start() { fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -134,17 +134,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } diff --git a/binsrc/samples/xpath/files2dav.sh b/binsrc/samples/xpath/files2dav.sh index 7a08ddec..9dbd5d6a 100755 --- a/binsrc/samples/xpath/files2dav.sh +++ b/binsrc/samples/xpath/files2dav.sh @@ -104,7 +104,7 @@ START_SERVER() starth=`date | cut -f 2 -d :` starts=`date | cut -f 3 -d :|cut -f 1 -d " "` - while true + for i in $(seq 1 10) do sleep 6 if (netstat -an | grep "$PORT" | grep LISTEN > /dev/null) @@ -112,19 +112,9 @@ START_SERVER() ECHO "Virtuoso server started" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done ECHO "***WARNING: Could not start Virtuoso DEMO Server within $timeout seconds" return 1 - fi - done } STOP_SERVER() diff --git a/binsrc/samples/xquery/files2dav.sh b/binsrc/samples/xquery/files2dav.sh index 62758bcb..db1e0ffd 100755 --- a/binsrc/samples/xquery/files2dav.sh +++ b/binsrc/samples/xquery/files2dav.sh @@ -104,7 +104,7 @@ START_SERVER() starth=`date | cut -f 2 -d :` starts=`date | cut -f 3 -d :|cut -f 1 -d " "` - while true + for i in $(seq 1 10) do sleep 6 if (netstat -an | grep "$PORT" | grep LISTEN > /dev/null) @@ -112,19 +112,9 @@ START_SERVER() ECHO "Virtuoso server started" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done ECHO "***WARNING: Could not start Virtuoso DEMO Server within $timeout seconds" return 1 - fi - done } STOP_SERVER() diff --git a/binsrc/sync/make_vad.sh b/binsrc/sync/make_vad.sh index 9b51134c..7ead91c5 100755 --- a/binsrc/sync/make_vad.sh +++ b/binsrc/sync/make_vad.sh @@ -113,7 +113,7 @@ virtuoso_start() { virtuoso +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting Virtuoso Server start on port $PORT..." @@ -124,17 +124,9 @@ virtuoso_start() { LOG "PASSED: Virtuoso Server successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/binsrc/tests/biftest/thook.sh b/binsrc/tests/biftest/thook.sh index 688cb5f0..e8b76d66 100755 --- a/binsrc/tests/biftest/thook.sh +++ b/binsrc/tests/biftest/thook.sh @@ -136,7 +136,7 @@ START_SERVER() rm $LOCKFILE fi RUN $SERVER +foreground $* & - while true + for i in $(seq 1 12) do sleep 5 stat=`netstat -an | grep "[\.\:]$port " | grep LISTEN` @@ -145,19 +145,9 @@ START_SERVER() LOG "PASSED: Virtuoso Server successfully started on port $port" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } echo "STARTED : thook.sh" echo "STARTED : thook.sh" > $OUTPUT diff --git a/binsrc/tests/suite/test_fn.sh b/binsrc/tests/suite/test_fn.sh index 040e7ff9..1b52c335 100755 --- a/binsrc/tests/suite/test_fn.sh +++ b/binsrc/tests/suite/test_fn.sh @@ -315,7 +315,7 @@ START_SERVER() then return fi - while true + for i in $(seq 1 60) do stat=`netstat -an | grep "[\.\:]$port " | grep LISTEN` if [ "z$stat" != "z" ] @@ -324,25 +324,15 @@ START_SERVER() return 0 fi sleep 1 - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } CHECK_PORT() { port=$1 - while true + for i in $(seq 1 60) do stat=`netstat -an | grep "[\.\:]$port " | grep LISTEN` if [ "z$stat" = "z" ] @@ -351,19 +341,9 @@ CHECK_PORT() return 0 fi sleep 1 - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***FAILED: Port $port is not freed during $timeout seconds" exit 1 - fi - done } STOP_SERVER() diff --git a/binsrc/tests/suite/tpc-d/tpcd.sh b/binsrc/tests/suite/tpc-d/tpcd.sh index 95e4143b..8636f938 100755 --- a/binsrc/tests/suite/tpc-d/tpcd.sh +++ b/binsrc/tests/suite/tpc-d/tpcd.sh @@ -207,7 +207,7 @@ START_SERVER () rm -f *.lck $SERVER +foreground -c tpcd.ini $* 1>/dev/null & stat="true" - while true + for i in $(seq 1 15) do sleep 4 stat=`netstat -an | grep "[\.\:]$PORT " | grep LISTEN` diff --git a/binsrc/tutorial/make_vad.sh b/binsrc/tutorial/make_vad.sh index e2e75aae..d04d6ae2 100755 --- a/binsrc/tutorial/make_vad.sh +++ b/binsrc/tutorial/make_vad.sh @@ -113,7 +113,7 @@ virtuoso_start() { "$SERVER" +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting $SERVER start on port $PORT..." @@ -124,17 +124,9 @@ virtuoso_start() { LOG "PASSED: $SERVER successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start $SERVER within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/binsrc/vsp/admin/debug/make_vad.sh b/binsrc/vsp/admin/debug/make_vad.sh index 55e329a2..dab35015 100755 --- a/binsrc/vsp/admin/debug/make_vad.sh +++ b/binsrc/vsp/admin/debug/make_vad.sh @@ -79,7 +79,7 @@ virtuoso_start() { virtuoso +wait fi stat="true" - while true + for i in $(seq 1 15) do sleep 4 echo "Waiting Virtuoso Server start on port $PORT..." @@ -90,17 +90,9 @@ virtuoso_start() { LOG "PASSED: Virtuoso Server successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } do_command_safe () { diff --git a/binsrc/vspx/suite/vspx_suite.sh b/binsrc/vspx/suite/vspx_suite.sh index d3d5239a..05166838 100755 --- a/binsrc/vspx/suite/vspx_suite.sh +++ b/binsrc/vspx/suite/vspx_suite.sh @@ -48,7 +48,7 @@ virtuoso_start() { rm -f *.lck $SERVER stat="true" - while true + for i in $(seq 1 15) do sleep 4 LOG "CHECKING: Is Virtuoso Server successfully started on port $PORT?" @@ -59,17 +59,9 @@ virtuoso_start() { LOG "PASSED: Virtuoso Server successfully started on port $PORT" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done LOG "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } do_command() { diff --git a/binsrc/yacutia/mkvad.sh b/binsrc/yacutia/mkvad.sh index 5c5144e9..c022158a 100755 --- a/binsrc/yacutia/mkvad.sh +++ b/binsrc/yacutia/mkvad.sh @@ -161,7 +161,7 @@ START_SERVER() starth=`date | cut -f 2 -d :` starts=`date | cut -f 3 -d :|cut -f 1 -d " "` - while true + for i in $(seq 1 10) do sleep 6 if (netstat -an | grep "$PORT" | grep LISTEN > /dev/null) @@ -169,19 +169,9 @@ START_SERVER() ECHO "Virtuoso server started" return 0 fi - nowh=`date | cut -f 2 -d :` - nows=`date | cut -f 3 -d : | cut -f 1 -d " "` - - nowh=`expr $nowh - $starth` - nows=`expr $nows - $starts` - - nows=`expr $nows + $nowh \* 60` - if test $nows -ge $timeout - then + done ECHO "***WARNING: Could not start Virtuoso Server within $timeout seconds" return 1 - fi - done } STOP_SERVER()