I am having big trouble with rc.local on my system.
My system is CentOS 5.5 64X
My default startup is is 3, so rc3.d is where I was looking into.
rc.local with permissions 755.
Inorder to solve the problem I made the following test.
1. No matter how I edit rc.local, it will not be executed, even a copy from other Linux system that runs rc.local fine.
2. All S99 service under rc3.d won't run when S99local is there.
3. All service executed just fine if S99local removed from rc3.d.
4. If I change S99local to S97local, Anything in S97, S98, S99 won't run.
5. I tested rc.local with
Code:
echo "rc.local is executed just fine" >> /root/test.txt
by adding it after "touch /var/lock/subsys/local" [FAILED, test.txt not found after restart]
6. I tried to execute rc.local with
it was SUCCESSFULLY executed without any error, and everything in rc.local runs fine.
Below here is my rc.local
Code:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
#
touch /var/lock/subsys/local
echo "rc.local is executed just fine" >> /root/test.txt
I have no idea what is going wrong with my system or my rc.local file. Thank you for helping me!!