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 #启动
然后重启就可以了
亲测可用