I have a script that needs to be run when os boots up. I added it to /etc/rc.local. It was working fine for sometime but now rc.local does not load at boot time.
When i checked the permissions on the file,
[root@localhost etc]# ls -al rc.local
-rw-rw-rw-. 1 root root 288 Mar 14 12:40 rc.local
So I used chmod a+x rc.local to set executable permission. But on reboot it didn't start. Again, ls -al rc.local showed that rc.local doesn't have executable permission.
Why did it get reset? How to make rc.local executable permanantly?
Update :
Ok, so I did chmod u+x rc.local and now when the os boots up, the file is displayed as having executable permission. But still it isn't getting executed.
Ouput of ls -lZ
[root@localhost etc]# ls -lZ rc.local
-rwxrw-rw-. root root unconfined_u:object_r:etc_t:s0 rc.local
.after the permissions in thelsoutput which indicates that the file has an selinux context. Can you add the output ofls -lZ rc.localto your question? – Flup Mar 14 at 15:11/etc/rc.local -> rc.d/rc.local. Have you created the target manually in/etc/rc.local? – Rahul Patil Mar 15 at 5:24/etc/rc.local. Should I delete it and recreate? – aswathi Mar 15 at 5:49