rc.local not running centos 6
The rc.local
script is used in CentOS 6 to run commands or scripts during the system boot process. If the rc.local
script is not running, there are a few possible reasons for this. Here are the steps you can take to troubleshoot and resolve the issue:
Check the permissions: Ensure that the
rc.local
file has executable permissions. You can use thels -l
command to check the permissions of the file. If it does not have executable permissions, you can use thechmod +x
command to add the execute permission.Verify the location: Confirm that the
rc.local
file is located in the correct directory. In CentOS 6, therc.local
file should be located in the/etc
directory. You can use thels
command to check if the file exists in the correct location.Check the contents of
rc.local
: Open therc.local
file and verify that the commands or scripts you want to run are correctly specified. Make sure there are no syntax errors or typos in the file. You can use a text editor likevi
ornano
to open the file.Enable the
rc.local
service: In CentOS 6, therc.local
service needs to be enabled for it to run during the system boot process. You can use thechkconfig
command to enable the service. Run the following command:chkconfig --add rc.local
Reboot the system: After making any changes to the
rc.local
file or enabling the service, it is recommended to reboot the system to ensure that the changes take effect. Use thereboot
command to restart the system.Check the logs: If the
rc.local
script is still not running after following the above steps, you can check the system logs for any error messages or clues about the issue. The relevant log files can be found in the/var/log
directory, such asboot.log
ormessages
.
By following these steps, you should be able to troubleshoot and resolve the issue of the rc.local
script not running in CentOS 6.