centos7 /etc/rc.local需要chmod +x /etc/rc.d/rc.local


Centos 7.0设置/etc/rc.local无效问题解决

安装centos7以后按照以往习惯修改rc.local添加开机启动命令,但重启后发现无效,再次重启发现依然如故

检查系统rc.local服务运行情况

systemctl | grep "rc.local" # rc-local.service loaded active running /etc/rc.d/rc.local Compatibility

发现运行正常

随后查看rc.local文件

vim /etc/rc.local

发现这么一句话

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

由于/etc/rc.local是/etc/rc.d/rc.local的软连接,所以必须确保/etc/rc.local和/etc/rc.d/rc.local都有x权限(可执行)

执行命令

chmod +x /etc/rc.d/rc.local

重启,一切正常,问题解决。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2024 CODEPRJ.COM