Hi I’m having a bit of trouble with setting up a rake task to run on startup/reboot of a ubuntu instance on Amazon EC2.
I need to make my instance start a simple delayed jobs “rake jobs:work” command when a new instance is launched, without me having to login using ssh, and run the command manually. The problem is – I can’t get it to execute the command. It works fine from terminal, but not by it self on startup. I have tried to follow the instructions in this link, but nothing seems to work.
I’m on a Natty 11.04 instance and I have installed ruby and gems through rvm.
You’ll need to call something in a bash script that looks like this:
Then call it from from your /etc/init.d/mystartup_filename. The file could look something like: