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

1 Answer

up vote 2 down vote accepted

Make sure the script file has exectable flag

  chmod filename.sh +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
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.