在Centos7下,rc.local文件,开机默认是不执行的

1.进入rc.local中 路径如下图

Centos7中rc.local设置springboot项目开机自启动

2.打开rc.local

Centos7中rc.local设置springboot项目开机自启动
Centos7中rc.local设置springboot项目开机自启动

 

 上面注释意思是:

这个文件是为兼容性而添加的
在开机过程中强烈建议创建自己的systemd服务或udev规则来运行脚本,而不是使用此文件
和以前版本相比,此脚本将不会在在其它服务后运行
记住,必须运行chmod +x/etc/rc.d/rc.local命令来确保启动过程中执行此脚本 .
因此我们应该给/etc/rc.d/rc.local加执行权限
chmod +x /etc/rc.d/rc.local

我之前就是因为没有给rc.local加执行权限,所以一直开机后项目没自动启动。

所以需要执行下 chmod +x /etc/rc.d/rc.local

 

相关文章:

  • 2022-01-10
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2021-10-11
  • 2021-06-01
  • 2021-05-30
  • 2022-01-15
  • 2021-09-24
相关资源
相似解决方案