Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

Thanks,

-M

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
add comment

2 Answers

up vote 5 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
add comment

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
add comment

Your Answer

 
discard

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.