-
由於在centos7中
/etc/rc.d/rc.local
的權限被降低了,所以需要賦予其可執行權chmod +x /etc/rc.d/rc.local
-
賦予腳本可執行權限
假設/opt/script/autostart.sh
是你的腳本路徑,給予執行權限chmod +x /opt/script/autostart.sh
- 打開/etc/rc.d/rc.local文件,在末尾增加如下內容
/opt/script/autostart.sh
- 加入是自己寫的shell腳本,而且帶有參數執行例如startbatch start all需要把這個腳本cp /data/app/cassiatant/startbatch.sh /etc/init.d/
- 然后