]> sourceware.org Git - systemtap.git/blob - stap-start-server
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
[systemtap.git] / stap-start-server
1 #!/bin/bash
2
3 # Start a systemtap server
4 #
5 # Copyright (C) 2008 Red Hat Inc.
6 #
7 # This file is part of systemtap, and is free software. You can
8 # redistribute it and/or modify it under the terms of the GNU General
9 # Public License (GPL); either version 2, or (at your option) any
10 # later version.
11
12 # This script attempts to start a systemtap server and echoes the
13 # process id, if successful.
14
15 # start the server
16 stap-serverd </dev/null >/dev/null 2>&1 &
17 server_pid=$!
18
19 # Make sure the server is started
20 for ((attempt=0; $attempt < 5; ++attempt))
21 do
22 (ps -a | grep $server_pid) >/dev/null 2>&1 && echo $server_pid && exit 0
23 sleep 1
24 done
25
26 exit 1 # server did not start
This page took 0.042451 seconds and 6 git commands to generate.