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 #啓動
然後重啓就可以了
親測可用