diff options
author | Dave Brolley <brolley@redhat.com> | 2008-08-08 15:11:36 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2008-08-08 15:11:36 -0400 |
commit | d5658775da9fa0ac792eb3f874df9f7c4d60de7e (patch) | |
tree | f20be52c08db77ff67bf3a448a76339aa5e4c98c /stap-find-or-start-server | |
parent | a4cc1d081ede55ed6c743147d62fcc3519f73a71 (diff) | |
download | systemtap-steved-d5658775da9fa0ac792eb3f874df9f7c4d60de7e.tar.gz systemtap-steved-d5658775da9fa0ac792eb3f874df9f7c4d60de7e.tar.xz systemtap-steved-d5658775da9fa0ac792eb3f874df9f7c4d60de7e.zip |
Start/stop the systemtap server from systemtap.exp and not in the top level Makefile.
Diffstat (limited to 'stap-find-or-start-server')
-rwxr-xr-x | stap-find-or-start-server | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/stap-find-or-start-server b/stap-find-or-start-server index 0ea0ef43..32a45052 100755 --- a/stap-find-or-start-server +++ b/stap-find-or-start-server @@ -10,27 +10,23 @@ # later version. # This script attempts to find a systemtap server. If one is found, it -# simply exits with 0. +# echoes 0 and exits with 0. # # Otherwise, it attempts to start a server. If succesful, it echoes the # process id and exits with 0. # -# Otherwise, it exits with 1 +# Otherwise, it echoes -1 and exits with 1 # Is there a server available? -stap-find-servers >/dev/null 2>&1 && exit 0 +stap-find-servers >/dev/null 2>&1 && echo 0 && exit 0 # No server available, try to start one. pid=`stap-start-server` if test $? = 0; then - echo $pid - # Make sure the server is started - for ((attempt=0; $attempt < 5; ++attempt)) - do - stap-find-servers >/dev/null 2>&1 && exit 0 - sleep 1 - done + echo $pid + exit 0 fi # Could not find or start a server +echo -1 exit 1 |