Skip to content

Instantly share code, notes, and snippets.

@TooTallNate
Created August 18, 2011 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save TooTallNate/1154971 to your computer and use it in GitHub Desktop.
Save TooTallNate/1154971 to your computer and use it in GitHub Desktop.
Example of using `upstart` with a NodeJS server.
description "My NodeJS Server"
author "Nathan Rajlich"
# Upstart has nothing in $PATH by default
env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Keep the server running on crash or machine reboot
respawn
start on runlevel [23]
# Start the server and redirect output to log files
script
cd /path/to/node-http-server
exec node server.js >>/var/log/node/http.log 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment