5 script_root=`dirname $0`
7 if [ -e CMakeCache.txt ]; then
9 elif [ -e $script_root/../build/CMakeCache.txt ]; then
10 script_root=`(cd $script_root/../build; pwd)`
13 [ "$#" -lt 1 ] && echo "usage: $0 <name> [entity [id]]" && exit 1
19 run_root=$script_root/run/$name
22 if [ "$entity" == "" ]; then
23 pfiles=`ls $pidpath/*.pid` || true
24 elif [ "$id" == "" ]; then
25 pfiles=`ls $pidpath/$entity.*.pid` || true
27 pfiles=`ls $pidpath/$entity.$id.pid` || true
30 for pidfile in $pfiles; do
32 fname=`echo $pidfile | sed 's/.*\///g'`
34 [ "$pid" == "" ] && exit
35 [ $pid -eq 0 ] && exit
38 entity=`echo $fname | sed 's/\..*//g'`
39 [ "$entity" == "radosgw" ] && extra_check="-e lt-radosgw"
40 echo entity=$entity pid=$pid
41 while ps -p $pid -o args= | grep -q -e $entity $extracheck ; do
42 cmd="kill $signal $pid"