大家好,我用樹莓派做了一個行車記錄器。
我把執行的路徑寫在 /etc/rc.local 中。
只不過不管怎麼試,都必須要用ssh先登入帳號才能夠自動執行程式......
後來把rc.local 裡的路徑丟進/etc/init.d 裡面也沒辦法......
請問一下有沒有開機不需要用ssh 登入就能夠自動執行程式的辦法?
rc.local 裡面是這樣寫,後來我把它丟進init.d也是不能開機後直接執行
#!/bin/sh
(/home/pi/dash/startPY.sh) &
下面是 startPY.sh 的程式碼
#!/bin/sh
(sleep 10;DISPLAY=0:0; sudo python /home/pi/dash/dashCorder.py)&
--
我把執行的路徑寫在 /etc/rc.local 中。
只不過不管怎麼試,都必須要用ssh先登入帳號才能夠自動執行程式......
後來把rc.local 裡的路徑丟進/etc/init.d 裡面也沒辦法......
請問一下有沒有開機不需要用ssh 登入就能夠自動執行程式的辦法?
rc.local 裡面是這樣寫,後來我把它丟進init.d也是不能開機後直接執行
#!/bin/sh
(/home/pi/dash/startPY.sh) &
下面是 startPY.sh 的程式碼
#!/bin/sh
(sleep 10;DISPLAY=0:0; sudo python /home/pi/dash/dashCorder.py)&
--
All Comments