Reputation: 33
I'm trying to start a script every time I start my amazon micro instance (amazon linux ami).
I tried to put it in /etc/init.d/ and linkted it to /etc/rc.d/ but the script is not executed.
I've also looked at user-data scripts, but as I understand the documentation they are only executed on the first startup of the instance.
What do I have to do to run my script on every startup?
Upvotes: 1
Views: 2379
Reputation: 19563
Init.d/rc.d are primarly used for services. Any scripts that you install here have to be enabled to run at boot chkconfig service on
.
Since it sounds like you are really just running a one time script. You can set it up to run with cron using the @reboot
flag instead of providing a time.
Upvotes: 3