Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 need to automatically issue a command on my CentOS 4.8 server after it reboots and/or powers up. Can someone please tell me where I can place this? Is there a configuration file somewhere for this?



share|improve this question
How soon after reboot does this command need to be executed? Before other daemons start? rc.local is about last in line. – Corey S. Dec 1 '09 at 13:22
Preferably about the last in line. – Mike B Dec 1 '09 at 20:48
up vote 6 down vote accepted

Just put in your crontab:

@reboot /usr/bin/whatever

This has the advantage that it can be done by non-superusers, which rc.local needs.

share|improve this answer
Nice. This is exactly what I was looking for. Thanks! – Mike B Dec 1 '09 at 20:49

You can run scripts upon boot by placing them in the /etc/rc.local file.

share|improve this answer
Thank you. This is great information too. – Mike B Dec 1 '09 at 20:53

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.