http://www.cnblogs.com/ainiaa/archive/2011/12/05/2276996.html
转自
http://blog.csdn.net/hcx25909/article/details/9068497
1、方法一,编辑rc.loacl脚本
所以我们可以直接在/etc/rc.local中添加启动脚本。
当然要添加到语句:exit 0 前面才行。
sudo vi /etc/rc.local
2、方法二,添加一个Ubuntu的开机启动服务。
可先将脚本复制或者软连接到/etc/init.d/目录下,
然后用:update-rc.d xxx defaults NN命令(NN为启动顺序),
注意如果脚本需要用到网络,则NN需设置一个比较大的数字,如99。
update-rc.d: warning: /etc/init.d/test missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/test ... /etc/rc0.d/K95test -> ../init.d/test /etc/rc1.d/K95test -> ../init.d/test /etc/rc6.d/K95test -> ../init.d/test /etc/rc2.d/S95test -> ../init.d/test /etc/rc3.d/S95test -> ../init.d/test /etc/rc4.d/S95test -> ../init.d/test /etc/rc5.d/S95test -> ../init.d/test
原文:http://www.cnblogs.com/woamazonniu/p/6322367.html