最近一个项目吧项目添加到/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把文件设置成可执行文件
评论区