Created
November 8, 2013 08:00
-
-
Save nnarhinen/7367732 to your computer and use it in GitHub Desktop.
Upstart script for running node as non-root service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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