meteor Deployment with Upstart Writing Your Upstart Script


You'll need an upstart script in your /etc/init/ directory. Name it with your app's name, ending in .conf, such as /etc/init/myapp.conf. The basic upstart script looks something like this:

## /etc/init/myapp.conf
description ""
author      ""

# Automatically Run on Startup
start on started mountall
stop on shutdown

# Automatically Respawn:
respawn limit 99 5

    export HOME="/root"
    export MONGO_URL='mongodb://'
    export ROOT_URL=''
    export PORT='80'

    exec /usr/local/bin/node /var/www/myapp/main.js >> /var/log/myapp.log 2>&1
end script