From 03914a0194db3fd98f60c3f8604701f0c6536d7a Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Wed, 26 Aug 2009 10:46:50 -0400 Subject: Allow 20 seconds for the server to start up. Use ps -e to check for server and avahi pids. --- stap-start-server | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stap-start-server b/stap-start-server index 6471db96..ac31d3bd 100755 --- a/stap-start-server +++ b/stap-start-server @@ -14,22 +14,23 @@ # Initialize the environment . `dirname $0`/stap-env +startup_timeout=20 # start the server ${stap_exec_prefix}stap-serverd "$@" /dev/null 2>&1 & server_pid=$! # Make sure the server is started -for ((attempt=0; $attempt < 10; ++attempt)) +for ((attempt=0; $attempt < $startup_timeout; ++attempt)) do # Has the server started? - if ! (ps -a | grep $server_pid) >/dev/null 2>&1; then + if ! (ps -e | grep $server_pid) >/dev/null 2>&1; then sleep 1 continue fi # Is avahi advertizing the server? - if ! (ps -fa | grep avahi-publish-service | grep $server_pid) > /dev/null 2>&1; then + if ! (ps -fe | grep avahi-publish-service | grep $server_pid) > /dev/null 2>&1; then sleep 1 continue fi -- cgit