summaryrefslogtreecommitdiffstats
path: root/stap-start-server
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-03-11 12:12:16 -0400
committerDave Brolley <brolley@redhat.com>2009-03-11 12:12:16 -0400
commit06ba5b2c104f5c1c613fdf9085897e56b0912209 (patch)
treeba3dff7b0bd64fc698e0146651ba7ea9857c2e46 /stap-start-server
parent89f3a1254ccf16a6828671c6e5bc407bc061f040 (diff)
downloadsystemtap-steved-06ba5b2c104f5c1c613fdf9085897e56b0912209.tar.gz
systemtap-steved-06ba5b2c104f5c1c613fdf9085897e56b0912209.tar.xz
systemtap-steved-06ba5b2c104f5c1c613fdf9085897e56b0912209.zip
2009-03-11 Dave Brolley <brolley@redhat.com>
PR 9936 * stap-find-servers (configuration): Set timeout to 10 seconds. (find_servers): Run avahi-browse in the background and wait for $timeout seconds for it to finish. Kill it if it does not finish. Use a temp file for avahi-browse output. (match_server): Use -t $timeout on read commands. * stap-start-server: Check for $server_pid as a running process and for avahi-publish-service running as a child of $server_pid in order to confirm that the server is running.
Diffstat (limited to 'stap-start-server')
-rwxr-xr-xstap-start-server19
1 files changed, 11 insertions, 8 deletions
diff --git a/stap-start-server b/stap-start-server
index f1f02d2f..d718ed30 100755
--- a/stap-start-server
+++ b/stap-start-server
@@ -25,17 +25,20 @@ server_pid=$!
# Make sure the server is started
for ((attempt=0; $attempt < 10; ++attempt))
do
- if test $EUID = 0; then
- if ! test -f $sysconfdir/systemtap/ssl/server/stap-server.cert; then
- sleep 1
- continue;
- fi
- elif ! test -f $HOME/.systemtap/ssl/server/stap-server.cert; then
+ # Has the server started?
+ if ! (ps -a | grep $server_pid) >/dev/null 2>&1; then
sleep 1
continue
fi
- (ps -a | grep $server_pid) >/dev/null 2>&1 && echo $server_pid && exit 0
- sleep 1
+ # Is avahi advertizing the server?
+ if ! (ps -fa | grep avahi-publish-service | grep $server_pid) > /dev/null 2>&1; then
+ sleep 1
+ continue
+ fi
+
+ # The server is ready
+ echo $server_pid
+ exit 0
done
exit 1 # server did not start