执行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.

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

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

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

 

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

相关文章:

  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2021-12-09
猜你喜欢
  • 2021-06-01
  • 2022-01-04
  • 2021-11-19
  • 2021-11-23
  • 2022-01-15
  • 2021-09-07
  • 2021-06-28
相关资源
相似解决方案