開機自啟動腳本


方法一:修改rc.local

1、因為在centos7中/etc/rc.d/rc.local的權限被降低了,所以需要賦予其可執行權
chmod +x /etc/rc.d/rc.local
2、賦予腳本可執行權限
假設/usr/local/script/autostart.sh是你的腳本路徑,給予執行權限
chmod +x /usr/local/script/autostart.sh
3、打開/etc/rc.d/rc.local文件,在末尾增加如下內容
/usr/local/script/autostart.sh


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2024 CODEPRJ.COM