Home > Operation and Maintenance > CentOS > How to solve the problem that rc.local does not execute when booting under centos7

How to solve the problem that rc.local does not execute when booting under centos7

WJ
Release: 2020-06-03 15:35:57
Original
2796 people have browsed it

How to solve the problem that rc.local does not execute when booting under centos7

How to solve the problem that rc.local is not executed when booting under centos7?

Execute the following two commands:

chmod +x /etc/rc.d/rc.local  #给予这个文件执行权限
systemctl enable rc-local.service  #开机启动这个服务
Copy after login

Under Centos7, the rc.local file is not executed by default at boot

Translation

This file was added for compatibility
It is strongly recommended to create your own systemd service or udev rule to run the script during the boot process instead of using this file
Compared with previous versions, this script will not run after other services
Remember, you must run the chmod x/etc/rc.d/rc.local command to ensure that this script is executed during the startup process.
So we should give /etc/rc .d/rc.local adds execution permission
chmod x /etc/rc.d/rc.local

Related reference:centOS tutorial

The above is the detailed content of How to solve the problem that rc.local does not execute when booting under centos7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template