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

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

安装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

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

相关文章:

  • 2021-12-22
  • 2021-07-13
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
猜你喜欢
  • 2021-10-17
  • 2022-12-23
  • 2021-06-09
  • 2021-05-27
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案