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?



  • 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

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.

|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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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