Skip to content

Instantly share code, notes, and snippets.

@davidwood
Created May 2, 2012 19:47
Show Gist options
  • Save davidwood/2579713 to your computer and use it in GitHub Desktop.
Save davidwood/2579713 to your computer and use it in GitHub Desktop.
Upstart script for node app
description "My awesome application daemon"
start on filesystem or runlevel [2345]
stop on shutdown
respawn
respawn limit 5 60 # Limit respawns to 5 failures in 60 seconds
env NODE_ENV=production
exec /usr/local/bin/node /path/to/application/app.js >> /path/to/application/logs/node.log 2>&1
@davidwood
Copy link
Author

This file is stored in /etc/init/myapp.conf. The application can be started with start myapp and stopped with stop myapp (might need sudo).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment