Dummy Question, put a script on startup fails

Hi all, im pretty new to unit/redhat 6.2
I am trying to load a script upon startup of my redhat 6.2
(instance in ec2 AWS if someone cares)

I want everytime when instance starts (after stop/reboot) a script i build to launch. when i run the script ./scriptname the script runs and everything is OK.
i added the following lines to /etc/rc.local by using "sudo vi /etc/local.rc"

#!/bin/sh
/etc/init.d/softimize-init
fi

Then i saved and exited.
then i stopped the instance, started it, and it does not perform the script.
if i do /etc/rc.local when i am logged it, it will apply it good..

Does rc.local is the proper place to put the command ?
Do i need to chmod the file after modifiying ?

I also tried to put it in chkconfig, to add the script, and it added it, but still does not run it on startup.

thanks

/etc/rc.local is executed only once during server boot. To run your script when the application is being started, you should add it to the application's start script. How are you starting the instance?

I am logged from console.aws.amazon.com EC2 dashboard..
and i start/stop instance from there.

hookedatwalla, to run a script system wide at start up on a Red Hat type system use /etc/rc.d/rc.local .

/etc/rc.local is for Deb based systems.

Hi again,
i debugged my problem, meaning i cat /var/log/boot.log
and saw:

/etc/rc3.d/S20softimize-init: line 10: ec2-associate-address: command not found

meaning, i guess, that system does not know what is ec2-associate-address during the time of starting services..

Why is that ? how can i bypass it ?
after im logged in from putty, if i ec2-associate-address then the command is known and working.