I learn meteorjs and I have a small remote VPS.
I want:
You should use Ubuntu way, which is Upstart:
http://upstart.ubuntu.com/ http://manpages.ubuntu.com/manpages/lucid/man5/init.5.html
How to define daemon job:
http://newcome.wordpress.com/2012/02/26/running-programs-as-linux-daemons-using-upstart/
Hope it helps :)
Your upstart file would be more or less:
# meteorjs - meteorjs job file
description "MeteorJS"
author "Igor S"
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
respawn
# Essentially lets upstart know the process will detach itself to the background
expect fork
# Run before process
pre-start script
cd PATH_TO_METEOR_APP
echo ""
end script
# Start the process
exec meteor run -p 80 --help -- production