Skip to content

Instantly share code, notes, and snippets.

@dantheman213
Last active February 4, 2017 00:19
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 dantheman213/14892e0880430a6573d940a7f1e3cf51 to your computer and use it in GitHub Desktop.
Save dantheman213/14892e0880430a6573d940a7f1e3cf51 to your computer and use it in GitHub Desktop.
NodeJS 'Upstart' Start-up script. Works on Ubuntu 14.04.
#!upstart
# NodeJS 'Upstart' Start-up script.
# Works on Ubuntu 14.04. Systemd is being used for Ubuntu 16.04 though.
description "your node js web app"
start on started mountall
stop on shutdown
# Automatically Respawn:
respawn
respawn limit 99 5
env NODE_ENV=production
script
cd /opt/yournodejsapp
exec npm start >> /var/log/yournodejsapp.log 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment