On an Amazon S3 Linux instance, I have two scripts called start_my_app
and stop_my_app
which start and stop forever (which in turn runs my
A simple approach is to add a line in /etc/rc.local
:
/PATH/TO/MY_APP &
or if you want to run the command as a special user :
su - USER_FOOBAR -c /PATH/TO/MY_APP &
(the trailing ampersand backgrounds the process and allows the rc.local to continue executing)
If you want a full init script, debian distro have a template file, so :
cp /etc/init.d/skeleton /etc/init.d/your_app
and adapt it a bit.