linux中rc.local设置开机自启没有生效

AndyYang| 阅读:543 发表时间:2021-10-09 17:35:38 linux
摘要:linux中在rc.local设置开机启动没有生效,需要给/etc/rc.d/rc.local 添加x权限

linux中在rc.local设置开机启动没有生效,

执行ll /etc/rc.local命令,发现/etc/rc.local映射文件是/etc/rc.d/rc.local

再ll /etc/rc.d/rc.local发现这个文件没有执行权限(少了x);

其实vi  /etc/rc.local有这样一段话

# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure

# that this script will be executed during boot.

所以执行chome +x  /etc/rc.d/rc.local命令后,启动可以执行这个文件了。


但是还有一个问题,需要保证rc.local文件里面执行的脚本都是可执行的,否则依然无效。

另外如果在rc.local添加多条重复的启动命令脚本,也是无效的。

摘自:https://www.cnblogs.com/link01/p/12165245.html
如果您觉得好,可以打赏作者:
如果您觉得累了,是否想看点美女养养眼:猛戳>>朋友帮
如果您觉得皮了,是否想来点神吐槽:猛戳>>iPhone查询中

已有0条评论

昵称:
邮箱:

  • 最新评论

iPhone查询中 - bbs.ipcxz.com 朋友帮 - www.pengyb.cn iPhone查询中 - bbs.ipcxz.com
反馈
微信订阅号