summaryrefslogtreecommitdiffstats
path: root/stap-find-or-start-server
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-08-06 12:06:06 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-08-06 12:06:06 -0400
commit3c4371661f144c331dd55ee6be8dab57ec2323c8 (patch)
tree217ccf5864840f14670138b592d90eceacc75fa3 /stap-find-or-start-server
parent44ab6f3be72e7b5eeaa2514cea0553b87007ee9c (diff)
parent0317fad416059781b7a152296c1d8b5a012bf925 (diff)
downloadsystemtap-steved-3c4371661f144c331dd55ee6be8dab57ec2323c8.tar.gz
systemtap-steved-3c4371661f144c331dd55ee6be8dab57ec2323c8.tar.xz
systemtap-steved-3c4371661f144c331dd55ee6be8dab57ec2323c8.zip
Merge commit 'origin/master' into pr4225
* commit 'origin/master': Use relative instead of absolute line. (bug 6611) move post-0.7 news tidbit to the top Add test for $$vars, $$params, $$locals. typographical tweaks for embedded script code Add $$vars, $$parms, $$locals Rename $path to $pathname of syscall tapset for 2.6.27 Correct several tests for 2.6.27 c code generation: assert C indentation/nesting cancels out at appropriate points Tweak test_installcheck for helloworld.meta and traceio2.meta. Run both tests for installcheck tests. No need for random suffix file cmdline and sysinfo files in the Ensure that a systemtap server is available if 'server' is specified session.h (struct systemtap_session): Added itrace_derived_probe * syscalls2.stp: Add sys_unlinkat. Fix on_each_cpu() call for kernels >2.6.26. Remove unused STAPCONF_MODULE_NSECTIONS
Diffstat (limited to 'stap-find-or-start-server')
-rwxr-xr-xstap-find-or-start-server36
1 files changed, 36 insertions, 0 deletions
diff --git a/stap-find-or-start-server b/stap-find-or-start-server
new file mode 100755
index 00000000..0ea0ef43
--- /dev/null
+++ b/stap-find-or-start-server
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Find or start a systemtap server
+#
+# Copyright (C) 2008 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
+# Public License (GPL); either version 2, or (at your option) any
+# later version.
+
+# This script attempts to find a systemtap server. If one is found, it
+# simply 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
+
+# Is there a server available?
+stap-find-servers >/dev/null 2>&1 && 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
+fi
+
+# Could not find or start a server
+exit 1