1.写好自己的需要开机启动的脚本(我的脚本)我的脚本名字是 myenv.sh
#!/bin/bash
source /etc/profile
2.然后把自己的脚本放到 /etc/init.d/下
3.给自己启动脚本赋予权限
sudo chmod 777 /etc/init.d/myenv.sh
4.把自己的脚本添加到系统启动脚本中
cd /etc/init.d/ update-rc.d myenv.sh defaults 90
90 是代表等级 数字越大 执行越晚 范围是0-100
5.移除脚本(使自己的开机脚本不自启 可以移除脚本)
cd /etc/init.d/
update-rc.d -f myenv.sh remove