How to use Rc.local on CentOS 8

During the Linux boot process, we run the script with rc.local. Due to the complicated process of the init script, it makes the user spend a lot of time using it. Many people are looking for ways to easily use rc.local on CentOS 8. That is why we wrote this blog to give you a quick overview of how to use rc.local on CentOS 8.

How to use Rc.local on CentOS 8

On Linux, rc.local is a process that comes into play when the system reboots or shuts down, or when running scripts that run at startup or terminate the process itself.

We understand the purpose of rc.local. As a first step, rc.local runs with one user or script, namely a distribution whose functions are usually started and stopped by system services. Following this thought, when the system starts up, it is used to start custom services when it goes into multi-user mode.

Also, it is only used to start this service. Reuse does not stop the system shutdown or restart. Therefore, it cannot be used when turning off the system.

From a system security point of view, we shouldn’t use it. So we are working on hacking or looping the security of the system:

First we will go to reboot the system and use some commands. In this case, find out its status using this command:

systemctl status rc-local

Checks if rc.local is active or deactivated. If it is not active, then issue the command:

chmod etc/rc.d/rc.local

Then use the following command:

systemctl restart rc-local

After that use this command:

systemctl status rc-local

You will now see this status as active. Finally, include the options with this command:

system enable rc-local

Conclusion

In this article, we have tried to explain how to use rc.local. If you have questions, write in the comments below.

Related Posts