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

How can i run shell script every time my system boot ( start up ) in linux (RHEL 5)?

share|improve this question
up vote 3 down vote accepted

echo /path/to/ >> /etc/rc.local

share|improve this answer

As dyasny said, you can add the script call to your /etc/rc.local.

Another (cleaner) way would be to write an init script for it, place it in /etc/init.d/yourservice and add rc links to it (I don't remember which command does that on RHEL5) so that it gets started in the right position during boot and stopped during halt (if necessary).

share|improve this answer
the command is chkconfig I guess :) – dyasny Feb 3 '10 at 10:10
Yep thanks. I'm more of a update-rc.d guy ;-) – ℝaphink Feb 3 '10 at 11:18
But update-rc.d doesn't accept arbitrary scripts. They have to be "LSB-compliant" or whatever. – allyourcode Oct 10 '11 at 21:27
@user38334: You wish, really... – ℝaphink Oct 11 '11 at 8:23

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.