centos開機自啓動

vi /etc/rc.d/init.d/xx.sh #創建

編寫自啓動腳本內容

例如:

#!/bin/sh
#chkconfig: 2345 80 90
#description:auto_run  這一行我沒加,chkconfig命令執行報錯可以添加上
chmod +x /home/aa.sh
sh /home/aa.sh

chmod +x /etc/rc.d/init.d/xx.sh #授權

chkconfig --add xx.sh #添加

chkconfig xx.sh on #啓動

然後重啓就可以了

親測可用

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章