Skip to content

Instantly share code, notes, and snippets.

Created Nov 8, 2013
What would you like to do?
Upstart script for running node as non-root service
description "Foo application Node.js service"
author "Niklas Närhinen"
setuid foo
start on (local-filesystems and net-device-up)
stop on shutdown
respawn limit 5 60
export NODE_ENV="production"
export PORT=3000
export PATH="$PATH:/home/foo/.nvm/v0.10.16/bin"
export COUCHDB_USER=""
export COUCHDB_PASS=""
export COUCHDB_HOST=""
export REDIS_PASS=""
export REDIS_HOST=""
export REDIS_PORT=""
$(which node) /home/foo/foo/migrate.js &&
$(which node) /home/foo/foo/app.js >> /var/log/foo/ 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment