# HG changeset patch # User andrewm # Date 1436986011 -3600 # Node ID 3ada83df91a59bb310a57ea291075c4167c5f889 # Parent a11e23f4e6af2fb8755d73af4ceebd9950384491 Support stopping looped BeagleRT programs running within screen diff -r a11e23f4e6af -r 3ada83df91a5 scripts/build_project.sh --- a/scripts/build_project.sh Wed Jul 15 19:40:15 2015 +0100 +++ b/scripts/build_project.sh Wed Jul 15 19:46:51 2015 +0100 @@ -64,7 +64,7 @@ # Stop BeagleRT and clean out old source files echo "Stopping BeagleRT and removing old source files..." -ssh -t -t $BBB_ADDRESS "kill -s 2 \`pidof BeagleRT\` 2>/dev/null; sleep 0.5; make sourceclean -C $BBB_PATH" +ssh -t -t $BBB_ADDRESS "screen -X -S BeagleRT quit ; pkill BeagleRT ; sleep 0.5; make sourceclean -C $BBB_PATH" # Copy new source files to the board echo "Copying new source files to BeagleBone..." diff -r a11e23f4e6af -r 3ada83df91a5 scripts/run_project.sh --- a/scripts/run_project.sh Wed Jul 15 19:40:15 2015 +0100 +++ b/scripts/run_project.sh Wed Jul 15 19:46:51 2015 +0100 @@ -42,7 +42,7 @@ echo "Running BeagleRT..." if [ $RUN_IN_FOREGROUND -eq 0 ] then - ssh $BBB_ADDRESS "kill -s 2 \`pidof BeagleRT\` 2>/dev/null ; sleep 0.5 ; screen -S BeagleRT -d -m $BBB_PATH/BeagleRT $COMMAND_ARGS" + ssh $BBB_ADDRESS "screen -X -S BeagleRT quit ; pkill BeagleRT ; sleep 0.5 ; screen -S BeagleRT -d -m $BBB_PATH/BeagleRT $COMMAND_ARGS" else - ssh -t $BBB_ADDRESS "kill -s 2 \`pidof BeagleRT\` 2>/dev/null ; sleep 0.5 ; screen -S BeagleRT $BBB_PATH/BeagleRT $COMMAND_ARGS" + ssh -t $BBB_ADDRESS "screen -X -S BeagleRT quit ; pkill BeagleRT ; sleep 0.5 ; screen -S BeagleRT $BBB_PATH/BeagleRT $COMMAND_ARGS" fi \ No newline at end of file diff -r a11e23f4e6af -r 3ada83df91a5 scripts/setup_board.sh --- a/scripts/setup_board.sh Wed Jul 15 19:40:15 2015 +0100 +++ b/scripts/setup_board.sh Wed Jul 15 19:46:51 2015 +0100 @@ -44,7 +44,7 @@ then # Stop BeagleRT if running and remove all files echo "Stopping BeagleRT and removing old files." - ssh $BBB_ADDRESS "kill -s 2 \`pidof BeagleRT\` 2>/dev/null ; sleep 0.5 ; rm -rf $BBB_PATH ; mkdir $BBB_PATH" + ssh $BBB_ADDRESS "screen -X -S BeagleRT quit ; pkill BeagleRT ; sleep 0.5 ; rm -rf $BBB_PATH ; mkdir $BBB_PATH" # Copy relevant files to BeagleBone Black echo "Copying new files to BeagleBone..." diff -r a11e23f4e6af -r 3ada83df91a5 scripts/stop_running.sh --- a/scripts/stop_running.sh Wed Jul 15 19:40:15 2015 +0100 +++ b/scripts/stop_running.sh Wed Jul 15 19:46:51 2015 +0100 @@ -5,4 +5,7 @@ BBB_ADDRESS="root@192.168.7.2" echo "Stopping BeagleRT..." -ssh $BBB_ADDRESS "kill -s 2 \`pidof BeagleRT\` 2>/dev/null" \ No newline at end of file + +# 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