Created
April 14, 2014 02:02
-
-
Save afuggini/10610733 to your computer and use it in GitHub Desktop.
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 "Snapter Upstart" | |
author "Ariel Fuggini" | |
env APP_NAME='snapter' | |
env PORT='3000' | |
env METEOR_SETTINGS="$(cat /vagrant/snapter/config/production/settings.json)" | |
env ROOT_URL="http://snapter.co" | |
env NODE_BIN='/usr/local/bin/node' | |
env MONGO_URL="mongodb://localhost:27017/meteor" | |
env SCRIPT_FILE="/home/snapter/bundle/main.js" | |
env RUN_AS="snapter" | |
start on (local-filesystems and net-device-up IFACE=eth0) | |
stop on shutdown | |
script | |
export LOG_FILE="/home/snapter/tracer.upstart.log" | |
touch $LOG_FILE | |
chown $RUN_AS:$RUN_AS $LOG_FILE | |
chdir "/home/snapter/" | |
exec sudo -u $RUN_AS sh -c "METEOR_SETTINGS=$METEOR_SETTINGS PORT=$PORT MONGO_URL=$MONGO_URL ROOT_URL='$ROOT_URL' $NODE_BIN $SCRIPT_FILE >> $LOG_FILE 2>&1" | |
end script | |
respawn | |
respawn limit 20 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment