blob: 97e7cacac9b60701effa90d8d0488bd6d8da45d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/bin/bash
# Find or start a systemtap server
#
# 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
# 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
# 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 echoes -1 and exits with 1
# INSTALL-HOOK These settings work for running the client from the source tree
# INSTALL-HOOK using the dejagnu test harness and will be overridden at install
# INSTALL-HOOK time.
exec_prefix=
# Is there a server available?
${exec_prefix}stap-find-servers >/dev/null 2>&1 && echo 0 && exit 0
# No server available, try to start one.
pid=`${exec_prefix}stap-start-server "$@"`
if test $? = 0; then
echo $pid
exit 0
fi
# Could not find or start a server
echo "-1"
exit 1
|