blob: 7bdf6064f1d4e4c34174704ea9c2c08a506c867c [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#!/bin/bash
2
Brian Silverman80353cb2013-03-19 18:27:53 -07003echo '/home/driver/tmp/robot_logs/%e-%s-%p-%t.coredump' > /proc/sys/kernel/core_pattern
4
brians343bc112013-02-10 01:53:46 +00005chrt -o 0 bash -c "export PATH=$PATH:/home/driver/robot_code/bin; starter_loop.sh $*" &
Brian Silverman138449e2014-04-12 17:13:15 -07006STARTER_LOOP_PID=$!
7echo Starter is ${STARTER_LOOP_PID}.
brians343bc112013-02-10 01:53:46 +00008#chrt -o 0 bash -c "while true; do cd /home/driver/mjpg-streamer2; ./server.sh; sleep 5; done" &
9
10# Log everything from the serial port...
11#SERIAL_LOG_FILE=$(date "/home/driver/tmp/robot_logs/serial_log.%F_%H-%M-%S")
12#chrt -o 0 bash -c "( stty -echo -echoe -echok 9600; cat > ${SERIAL_LOG_FILE} ) < /dev/ttyUSB0" &
13
14# Wireshark _everything_ we can see...
15#DUMPCAP_LOG_FILE=$(date "/home/driver/tmp/robot_logs/dumpcap.%F_%H-%M-%S")
16#DUMPCAP_STDOUT_FILE=$(date "/home/driver/tmp/robot_logs/stdout_dumpcap.%F_%H-%M-%S")
17#chrt -o 0 bash -c "dumpcap -i eth0 -w ${DUMPCAP_LOG_FILE} -f 'not port 8080 and not net 10.9.71.13' > ${DUMPCAP_STDOUT_FILE}" &
18
Brian Silverman138449e2014-04-12 17:13:15 -070019# Run netconsole to record what the cRIO sends.
20chrt -o 0 bash -c '
21NETCONSOLE_BASE=/home/driver/tmp/robot_logs/netconsole-
22existing=$(ls ${NETCONSOLE_BASE}*)
23if [[ $? -eq 0 ]]; then
24 i=$(echo ${existing} | sed "s,${NETCONSOLE_BASE},,g; s/ /\n/g" | sort -g | tail -n1)
25else
26 i=0
27fi
28while true; do
29 /home/driver/robot_code/bin/netconsole ${NETCONSOLE_BASE}$((++i))
30 sleep 1
31done
32' &
33NETCONSOLE_PID=$!
34echo Netconsole is ${NETCONSOLE_PID}.
35
36echo $$ > /tmp/starter.pid