失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > ubuntu 开机启动shell脚本

ubuntu 开机启动shell脚本

时间:2023-01-13 06:12:32

相关推荐

ubuntu 开机启动shell脚本

1.创建shell启动脚本test

2.将启动脚本复制到 /etc/init.d 目录下

3.设置脚本文件权限

sudo chmod 755 /etc/init.d/test

4.设置脚本启动

sudo update-rc.d test defaults 95 //95 为启动优先级,越小优先级越高

// 执行后输出信息

update-rc.d: warning: /etc/init.d/test missing LSB informationupdate-rc.d: see </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/test4.卸载启动脚本

sudo update-rc.d -f test remove

// 执行后输出信息

Removing any system startup links for /etc/init.d/test ... /etc/rc0.d/K95test /etc/rc1.d/K95test /etc/rc2.d/S95test /etc/rc3.d/S95test /etc/rc4.d/S95test /etc/rc5.d/S95test /etc/rc6.d/K95test

如果觉得《ubuntu 开机启动shell脚本》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。