How to set startup items in CentOS7?
In CentOS 7, you can configure the boot settings using the following steps.
- Open the terminal and log in as the root user.
- Open the /etc/rc.local file with a text editor.
sudo vi /etc/rc.local
- The script called “startup.sh” located in the user’s home directory
/home/user/startup.sh
- Save and close the file.
- Grant execute permission to the /etc/rc.local file.
sudo chmod +x /etc/rc.local
- local resource control
sudo systemctl enable rc-local
- Restart the system to apply changes.
sudo reboot
In the future, the command or script you specify will automatically run when the system starts up.
Please note that in CentOS 7, the /etc/rc.local file is empty by default. If the file does not exist, you can create a new file and follow the steps above to configure it.