Last active
August 29, 2015 14:20
-
-
Save techjacker/8e9dd09c180bbe59c665 to your computer and use it in GitHub Desktop.
Node.js app init with Upstart
This file contains hidden or 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
# /etc/init/nodejsservice.conf | |
description "Node Restart Script: Using Upstart" | |
author "Andrew Griffiths" | |
start on (local-filesystems and net-device-up IFACE=eth0) | |
stop on shutdown | |
setuid www-data | |
setgid www-data | |
respawn # default = 10 respawns per 5 seconds | |
respawn limit 99 5 # 99 respawns per 5 seconds | |
# Max open files are @ 1024 by default. Bit few. | |
limit nofile 32768 32768 | |
script | |
. '/home/some_user/install-script/env_vars.conf' | |
export NODE_ENV | |
/opt/joyent/node/bin/node ${APP} >> ${LOGPATHAPP} 2>&1 | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment