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:

  1. Check the permissions: Ensure that the rc.local file has executable permissions. You can use the ls -l command to check the permissions of the file. If it does not have executable permissions, you can use the chmod +x command to add the execute permission.

  2. Verify the location: Confirm that the rc.local file is located in the correct directory. In CentOS 6, the rc.local file should be located in the /etc directory. You can use the ls command to check if the file exists in the correct location.

  3. Check the contents of rc.local: Open the rc.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 like vi or nano to open the file.

  4. Enable the rc.local service: In CentOS 6, the rc.local service needs to be enabled for it to run during the system boot process. You can use the chkconfig command to enable the service. Run the following command: chkconfig --add rc.local

  5. 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 the reboot command to restart the system.

  6. 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 as boot.log or messages.

By following these steps, you should be able to troubleshoot and resolve the issue of the rc.local script not running in CentOS 6.