Skip to content

Instantly share code, notes, and snippets.

@barrysteyn
Created January 6, 2013 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barrysteyn/4467515 to your computer and use it in GitHub Desktop.
Save barrysteyn/4467515 to your computer and use it in GitHub Desktop.
Running a Node process under NVM that uses upstart.
start on runlevel [2345]
stop on runlevel [06]
setuid devuser #don't run the process as root. You are asking for trouble if you do
setgid devuser
env NODEFOLDER=/home/dev/node-script
script
chdir $NODEFOLDER
exec bash -c 'source /home/dev/nvm/nvm.sh && exec node app'
end script
start on startup
respawn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment