linux 自動啟動 py
- 切換到root賬戶 sudo su
- 修改rc.local文件 sudo nano /etc/rc.local
- 在exit 0 之前添加執行命令 nohup /path/to/myscript &
- nano ctrl +o 後按enter
- sudo chmod 755 /path/to/myscript
myscript 內容延遲30秒啟動
sleep 30
sudo /xxx/xxx/xxx.py
http://www.itread01.com/content/1506423484.html
http://hj1984930.github.io/linux-sleep/
需要 gui的話 for rpi
http://www.raspberry-projects.com/pi/pi-operating-systems/raspbian/auto-running-programs-gui
sudo nano /root/.config/lxsession/LXDE-pi/autostart
+上這行測試(會打開sh)
@lxterminal
+自訂script
@sudo xxxxxxxxxxx