1

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
EEAA
  • 108,414
  • 18
  • 172
  • 242
Adam
  • 505
  • 1
  • 6
  • 10
  • possible duplicate of [Running Script on EC2 Boot](http://serverfault.com/questions/301918/running-script-on-ec2-boot) – EEAA Sep 25 '12 at 21:26

1 Answers1

2

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.

senorsmile
  • 713
  • 8
  • 19