# HG changeset patch # User Giulio Moro # Date 1463503369 -3600 # Node ID 8329f234d9149c2bcca0c324fbd37f9df19042fc # Parent 3c3d042dad124aa58ece5cfee4f1f22dc43efb80 Stop running by parsing the Xenomai stat diff -r 3c3d042dad12 -r 8329f234d914 .hgignore --- a/.hgignore Tue May 17 16:07:45 2016 +0100 +++ b/.hgignore Tue May 17 17:42:49 2016 +0100 @@ -14,3 +14,4 @@ html/* projects/heavy/hvtemp .*.DS_Store +.*swp diff -r 3c3d042dad12 -r 8329f234d914 scripts/stop_running.sh --- a/scripts/stop_running.sh Tue May 17 16:07:45 2016 +0100 +++ b/scripts/stop_running.sh Tue May 17 17:42:49 2016 +0100 @@ -4,8 +4,8 @@ BBB_ADDRESS="root@192.168.7.2" -echo "Stopping BeagleRT..." - # The first command should be sufficient to stop any BeagleRT run with # these scripts; the second will catch any leftovers run other ways -ssh $BBB_ADDRESS "screen -X -S BeagleRT quit ; pkill BeagleRT" \ No newline at end of file + +BELA_AUDIO_THREAD_NAME=beaglert-audio +ssh $BBB_ADDRESS 'PID=`grep '"$BELA_AUDIO_THREAD_NAME"' /proc/xenomai/stat | cut -d " " -f 5 | sed s/\s//g`; if [ -z $PID ]; then printf ""; else echo "Killing old Bela process $PID"; kill -2 $PID; fi'