Skip to content

Instantly share code, notes, and snippets.

@nnarhinen nnarhinen/foo.conf
Created Nov 8, 2013

Embed
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
respawn limit 5 60
script
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/foo.com.log 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.