Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running CentOS and want to execute a command when the system is booted. Reading other posts on ServerFault the recommend file to use is rc.local. However, rc.local exists in both /etc/ and /etc/rc.d/. Which file should I use, and what is the difference between the two?


share|improve this question
/etc/rc.local is a symlink to /etc/rc.d/rc.local – Laurentiu Roescu Mar 22 '13 at 13:43

I am retarded, /etc/rc.local is a symlink to /etc/rc.d/rc.local.

share|improve this answer
Just put everything before the "exit 0" and your are good to go :) . Try to use full path of the comands like "/sbin/iptables" for example to avoid problems. – nwildner Mar 22 '13 at 14:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.