summaryrefslogtreecommitdiffstats
path: root/stap-find-or-start-server
diff options
context:
space:
mode:
Diffstat (limited to 'stap-find-or-start-server')
-rwxr-xr-xstap-find-or-start-server12
1 files changed, 8 insertions, 4 deletions
diff --git a/stap-find-or-start-server b/stap-find-or-start-server
index 32a45052..efe23558 100755
--- a/stap-find-or-start-server
+++ b/stap-find-or-start-server
@@ -2,7 +2,7 @@
# Find or start a systemtap server
#
-# Copyright (C) 2008 Red Hat Inc.
+# Copyright (C) 2008, 2009 Red Hat Inc.
#
# This file is part of systemtap, and is free software. You can
# redistribute it and/or modify it under the terms of the GNU General
@@ -17,16 +17,20 @@
#
# Otherwise, it echoes -1 and exits with 1
+# Where are we installed?
+exec_prefix=`dirname $0`
+exec_prefix=`cd $exec_prefix && pwd`
+
# Is there a server available?
-stap-find-servers >/dev/null 2>&1 && echo 0 && exit 0
+$exec_prefix/stap-find-servers >/dev/null 2>&1 && echo 0 && exit 0
# No server available, try to start one.
-pid=`stap-start-server`
+pid=`$exec_prefix/stap-start-server "$@"`
if test $? = 0; then
echo $pid
exit 0
fi
# Could not find or start a server
-echo -1
+echo "-1"
exit 1