]> sourceware.org Git - systemtap.git/commitdiff
Add extra check for lock file before trying to call bmsubmit
authorLukas Berk <lberk@redhat.com>
Fri, 26 Apr 2013 21:20:54 +0000 (17:20 -0400)
committerLukas Berk <lberk@redhat.com>
Wed, 1 May 2013 15:13:36 +0000 (11:13 -0400)
*java/stapbm: add extra check for the lock file before submitting the check,
      change sdterr redirect (wasn't actually redirecting)

java/stapbm

index 1b6c1ebc1b2d08dda59d5771e37006847ffb3c94..1d5fe02fc248dc4c02093f7fe17fd135f2c8ebaf 100755 (executable)
@@ -9,7 +9,6 @@
 # $7 - number of args
 # $8 - entry/exit/line
 
-
 #We need to both record, and check that this pid is the first
 #This is to avoid recurssion in probing java processes
 FILE=`hostname`-$$
@@ -35,11 +34,16 @@ function submit_byteman()
        exec bmsubmit.sh -l $4/java/$3.btm 2>&1 1>/dev/null &
        pida=$!
        wait $pida
-       rm $4/java/`hostname`-submit 2>&1 1>/dev/null
+       rm $4/java/`hostname`-submit 2>/dev/null 1>/dev/null
        exit
     else
-       sleep 1
-       submit_byteman $1 $2 $3 $4
+       if [[ ! -f $4/java/`hostname`-submit ]]
+       then
+           submit_byteman $1 $2 $3 $4
+       else
+           sleep 0.5
+           submit_byteman $1 $2 $3 $4
+       fi
     fi
 }
 
@@ -69,9 +73,10 @@ function run_byteman()
            submit_byteman $1 $2 $3 $4
            ;;
        uninstall)
-           exec bmsubmit.sh -u $4/java/$3.btm &
-           pidb=$!
-           wait $pidb
+#          exec bmsubmit.sh -u $4/java/$3.btm &
+#          pidb=$!
+#          wait $pidb
+           rm $4/java/$3.btm
            exit
            ;;
        *)
This page took 0.025866 seconds and 5 git commands to generate.