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

1 Answer 1


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.

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.