Created
August 18, 2011 19:40
-
-
Save TooTallNate/1154971 to your computer and use it in GitHub Desktop.
Example of using `upstart` with a NodeJS server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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