Created
April 12, 2015 07:02
-
-
Save samarpanda/5bef77db3b8eec9ff7e9 to your computer and use it in GitHub Desktop.
Adding upstart configuration to start a node service
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 "app/http_server.js" | |
author "Samar - http://samarpanda.com" | |
# used to be: start on startup | |
# until we found some mounts weren't ready yet while booting: | |
start on started mountall | |
stop on shutdown | |
# Automatically Respawn: | |
respawn | |
respawn limit 99 5 | |
script | |
# Not sure why $HOME is needed, but we found that it is: | |
export HOME="/root" | |
exec /home/samar/github/nvm/v0.10.32/bin/node /home/samar/projects/node-http-shell/app/http_server.js >> /var/log/node-http-shell.log 2>&1 | |
end script | |
post-start script | |
# Optionally put a script here that will notifiy you node has (re)started | |
# /root/bin/hoptoad.sh "node.js has started!" | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment