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 one command line to run at startup. I've tested the command (it re-assosiates an Amazon IP to a Linux Server) and the command run successfully.

Just need to know the best method to execute this on server reboot? The server is RedHat and I've read a bit about /etc/init.d but still unsure.

command is:

ec2-associate-address -v -i i-xxx --region ap-southeast-1 -O key -W secret
share|improve this question
possible duplicate of Running Script on EC2 Boot – EEAA Sep 25 '12 at 21:26
up vote 2 down vote accepted

Make sure the script file has exectable flag

  chmod +x

I would recommend putting it in /etc/rc.local. Also, make sure there is a


at the end of the line of the script so that it runs in the background and doesn't stop other things from running.

share|improve this answer

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.