Created
July 24, 2012 15:29
-
-
Save mattmcmanus/3170666 to your computer and use it in GitHub Desktop.
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
#!upstart | |
description "Accountable" | |
author "mattmcmanus" | |
start on (local-filesystems and net-device-up IFACE=eth0) | |
stop on shutdown | |
respawn | |
respawn limit 5 60 # give up restart after 5 respawns in 60 seconds | |
script | |
echo $$ > /var/run/accountable.pid | |
cd /var/node/accountable/ | |
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/node/accountable/logs/app.log | |
exec sudo -u node NODE_ENV=production /usr/local/bin/node app.js >> /var/node/accountable/logs/app.log 2>&1 | |
end script | |
pre-stop script | |
rm /var/run/accountable.pid | |
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/node/accountable/logs/app.log | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment