幾種樹莓派開機自啟程式的方法
阿新 • • 發佈:2019-02-16
#/etc/init.d/start
### BEGIN INIT INFO
# Provides: start_tool
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start
# Description: This service is used to start my applaction
### END INIT INFO
case "$1" in
start)
echo "Starting app"
nohup python3 /home/pi/share/coper_crawler.py &
nohup python3 /home/pi/share/django_web1/manage.py runserver 0.0.0:8000 &
nohup python3 /home/pi/share/pythonweb-1.3/test/test.py &
;;
stop)
echo "Stop"
#kill $( ps aux | grep -m 1 'python3 /home/pi/share/start.py' | awk '{ print $2 }')
;;
*)
echo "Usage: service start_tool start|stop"
exit 1
;;
esac
exit 0