From: Stack Overflow post
- Install upstart
sudo apt-get install upstart
- Add a version of the
upstart.sh
file below to/etc/init
- Start your app:
sudo start yourappname
You can also start/stop/check status of scripts from the commandline:
start yourappname
stop yourappname
status yourappname
From: http://www.cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot/
add a @reboot
entry to crontab crontab -e
:
@reboot /home/vivek/bin/installnetkit.sh
You also need to enable the @reboot startup task:
update-rc.d cron defaults
Examples:
@reboot ec2-associate-address $EC2_ELASTIC_IP -i $EC2_INSTANCE_ID
@reboot "forever -m10 start /usr/share/tilemill/index.js --server=true --listen$
@reboot echo "asdf" > /tmp/reboot.txt
Just edit the /etc/rc.local
file and add whatever calls you want before exit 0
:
ec2-associate-address $EC2_ELASTIC_IP -i $EC2_INSTANCE_ID
For details, see https://help.ubuntu.com/community/UbuntuBootupHowto.
@todo: add other alternatives