Created
August 22, 2011 20:36
-
-
Save kenperkins/1163461 to your computer and use it in GitHub Desktop.
Clipboard.com Upstart script for Node
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
#!upstart | |
description "clipboard.com app server" | |
author "Ken Perkins & Mark Dawson (c) 2011" | |
env NAME=clipboard-app | |
env APP=clipboard-app.js | |
env LOGFILE=/home/clipboard/clipboard-app.log | |
env ERRORFILE=/home/clipboard/clipboard-app-error.log | |
env HOME="/home/clipboard/node/apps" | |
start on runlevel [2345] | |
stop on runlevel [016] | |
kill timeout 30 | |
respawn | |
script | |
export NODE_ENV=production | |
export HOSTNAME=`hostname` | |
export NODE_PATH="/usr/local/lib/node:/home/clipboard/node" | |
timeA=`date +%s` | |
echo "$NAME started at $timeA" >> $LOGFILE | |
exec sudo -u clipboard /usr/local/bin/node $HOME/$APP 1>>$LOGFILE 2>>$ERRORFILE | |
end script | |
post-stop script | |
timeA=`date +%s` | |
echo "$NAME stopped at $timeA" >> $LOGFILE | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment