-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
I use this for debugging -- on a normal boot it starts up the expected
lasersaur demon, but from bash you can do this:
root@laserdev:~# /etc/init.d/lasaurapp.sh debug
and it will turn on debugging and dump a bunch of useful info to the
console.
#!/bin/bash
# place in: /etc/init.d/lasaurapp.sh
# make executable: sudo chmod 755 /etc/init.d/lasaurapp.sh
# activate with: sudo update-rc.d lasaurapp.sh defaults
# deactivate with: sudo update-rc.d -f lasaurapp.sh remove
#if test "$1" = "start"
#then
#echo "Starting driveboardapp ..."
#/usr/bin/python /root/LasaurApp/backend/app.py -p --beaglebone
#fi
LASAURAPP="/root/driveboardapp/backend/app.py"
LASAURPROC="driveboardapp\/backend\/app\.py"
case "$1" in
start)
echo "Starting driveboardapp ..."
echo -n "at "
date
/usr/bin/python $LASAURAPP
;;
stop)
echo "Stopping driveboardapp ..."
ps ax | awk "/$LASAURPROC/ "'{ system("kill " $1) }'
;;
restart)
echo "Restarting driveboardapp ..."
echo "Stopping driveboardapp ..."
ps ax | awk "/$LASAURPROC/ "'{ system("kill " $1) }'
echo "Starting driveboardapp ..."
/usr/bin/python $LASAURAPP
;;
debug)
echo "Restarting driveboardapp in debug mode..."
echo "Stopping driveboardapp ..."
ps ax | awk "/$LASAURPROC/ "'{ system("kill " $1) }'
echo "Starting driveboardapp ..."
/usr/bin/python $LASAURAPP --debug
;;
*)
echo "Usage: /etc/init.d/lasersaur {start|stop|restart|debug}" >&2
exit 1
esac
J. Eric Townsend, IDSA
Metadata
Metadata
Assignees
Labels
No labels