Skip to content

Instantly share code, notes, and snippets.

@schkovich
Created May 6, 2014 11:14
Show Gist options
  • Save schkovich/56879658afd28e1a918d to your computer and use it in GitHub Desktop.
Save schkovich/56879658afd28e1a918d to your computer and use it in GitHub Desktop.
Upstart script to control nodejs application
# start when networking is up
start on net-device-up IFACE!=lo
# stop on shutting down the system
stop on runlevel [016]
# application environment
# staging and development instances should use override file to define environment
env NODE_ENV=production
# respawn the job up to 10 times within a 5 second period.
# If the job exceeds these values, it will be stopped and marked as failed.
respawn
respawn limit 10 5
# ssl-cert group can read certificates
setuid www-data
setgid ssl-cert
# adjust the path to the nodejs application
exec /usr/bin/nodejs /home/vagrant/opt/app.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment