summaryrefslogtreecommitdiffstats
path: root/stap-find-servers
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-05-04 16:05:22 -0400
committerDave Brolley <brolley@redhat.com>2009-05-04 16:05:22 -0400
commit2035bcd40b17832439df0a1eb28403b99a71b74f (patch)
tree0fb027ba40f34513279f2e39e1110b50a415d2c1 /stap-find-servers
parent3ba2eb82cafa938c1c3f7ef9d2da06912a49d8e0 (diff)
downloadsystemtap-steved-2035bcd40b17832439df0a1eb28403b99a71b74f.tar.gz
systemtap-steved-2035bcd40b17832439df0a1eb28403b99a71b74f.tar.xz
systemtap-steved-2035bcd40b17832439df0a1eb28403b99a71b74f.zip
Module signing and verification using a separate file for the module signature.
Diffstat (limited to 'stap-find-servers')
-rwxr-xr-xstap-find-servers19
1 files changed, 8 insertions, 11 deletions
diff --git a/stap-find-servers b/stap-find-servers
index fde7d9ef..77cd267a 100755
--- a/stap-find-servers
+++ b/stap-find-servers
@@ -12,15 +12,12 @@
# This script uses avahi to find systemtap compile servers on the local
# network. Information about each server found is printed to stdout.
+# Initialize the environment
+. `dirname $0`/stap-env
+
#-----------------------------------------------------------------------------
# Helper functions.
#-----------------------------------------------------------------------------
-# function: configuration
-function configuration {
- avahi_service_tag=_stap._tcp
- timeout=10 # seconds
-}
-
# function: initialization
function initialization {
rc=1 # not found yet
@@ -29,6 +26,7 @@ function initialization {
else
find_all=0
fi
+ timeout=10 # seconds
}
# function: find_servers
@@ -37,12 +35,12 @@ function initialization {
function find_servers {
# Create a temp file for the list of servers. We do this instead
# of using a pipe so that we can kill avahi-browse if it
- # takes more than a minute.
+ # takes too long.
tmpfile=`mktemp -t stap-serversXXXXXX` || \
fatal "Cannot create temporary file " $tmpfile
# Find servers
- avahi-browse $avahi_service_tag --terminate -r 2>/dev/null > $tmpfile &
+ avahi-browse $stap_avahi_service_tag --terminate -r 2>/dev/null > $tmpfile &
for ((attempt=0; $attempt < $timeout; ++attempt))
do
@@ -97,7 +95,7 @@ function match_server {
;;
address )
# Sometimes (seems random), avahi-resolve-host-name resolves a local server to its
- # hardware address rather its ip address. Keep trying until we get
+ # hardware address rather than its ip address. Keep trying until we get
# an ip address.
server_ip=`expr "$service_data" : '\[\([^]]*\)\]'`
local attempt
@@ -125,7 +123,7 @@ function match_server {
esac
done
- # It is a stap server, but is it compatible?
+ # It's an stap server, but is it compatible?
if test $find_all = 0 -a "$server_sysinfo" != "`client_sysinfo`"; then
continue
fi
@@ -159,7 +157,6 @@ function fatal {
#-----------------------------------------------------------------------------
# Beginning of main line execution.
#-----------------------------------------------------------------------------
-configuration
initialization "$@"
find_servers