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

执行ll/etc/rc.local命令,并发现/etc/rc.local映射文件为/etc/rc.d/rc.local[en]Execute the ll / etc/rc.local command and find that the / etc/rc.local mapping file is / etc/rc.d/rc.local

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

事实上,在vi/etc/rc.local中有一段。[en]In fact, there is a passage in 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.

因此,在执行chmod+x/etc/rc.d/rc.local命令之后,STARTUP就可以执行文件了。[en]So after executing the chmod + x / etc/rc.d/rc.local command, startup is ready to execute the file.

但还有一个问题,您需要确保在rc.local文件中执行的脚本是可执行的,否则它们仍然无效。[en]But there is another problem, you need to make sure that the scripts executed in the rc.local file are executable, otherwise they are still invalid.

此外,如果将多个重复的启动命令脚本添加到rc.local,也是无效的。[en]In addition, if you add multiple duplicate startup command scripts to rc.local, it is also invalid.

转自https://www.cnblogs.com/link01/p/12165245.html

Original: https://www.cnblogs.com/hark0623/p/14918216.html
Author: HarkLee
Title: linux中rc.local设置开机自启没有生效

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/6010/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

发表回复

登录后才能评论
免费咨询
免费咨询
扫码关注
扫码关注
联系站长

站长Johngo!

大数据和算法重度研究者!

持续产出大数据、算法、LeetCode干货,以及业界好资源!

2022012703491714

微信来撩,免费咨询:xiaozhu_tec

分享本页
返回顶部