侧边栏壁纸
博主头像
爱运维 博主等级

行动起来,活在当下

  • 累计撰写 197 篇文章
  • 累计创建 143 个标签
  • 累计收到 21 条评论

目 录CONTENT

文章目录

centos7 rc.local开机脚本不执行

Administrator
2019-08-27 / 0 评论 / 0 点赞 / 7 阅读 / 0 字
最近一个项目吧项目添加到/etc/rc.local让他开机自启,但是发现一次断电后他并没有启动
然后去检查了下 发现里面解释如下
[root@localhost ~]# cat /etc/rc.local 
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
cd /data/wifi/ && bash start.sh
大体意思是:这个是个兼容性文件,最好用systemd services or udev方式来自启,当然也可以用但是需要chmod +x /etc/rc.d/rc.local把文件设置成可执行文件
0

评论区