Skip to content

Instantly share code, notes, and snippets.

@attomos
Forked from matteocrippa/gist:5706448
Created July 22, 2013 18:12
Show Gist options
  • Save attomos/6056139 to your computer and use it in GitHub Desktop.
Save attomos/6056139 to your computer and use it in GitHub Desktop.
UPSTART
sudo vi /etc/init/<reponame>.conf
add inside:
description "<reponame>"
author "name"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
respawn
respawn limit 5 60
script
export NODE_ENV=production
export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules
cd /var/www/<reponame>
exec /usr/local/bin/nodemon --exitcrash app.js 2>&1 >> /var/log/<reponame>.log
end script
MONIT
sudo vi /etc/monit/monitrc
(on top only the first time)
set daemon 120
(then new repo)
#<reponame>
check host <reponame> with address 127.0.0.1
start program = "/sbin/start <reponame>"
stop program = "/sbin/stop <reponame>"
if failed port <repoPort> protocol HTTP
request /
with timeout 5 seconds
then restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment