Last active
December 22, 2015 18:49
-
-
Save chriswessels/6515635 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 "Leaderboard Upstart" | |
author "Chris Wessels" | |
env APP_NAME='leaderboard' | |
env PORT='2000' | |
env ROOT_URL='http://www.your-app.com' | |
env NODE_BIN='/home/meteor/.nvm/v0.8.24/bin/node' | |
env SCRIPT_FILE="bundle/main.js" # Entry point for the nodejs app | |
env RUN_AS="meteor" | |
start on (local-filesystems and net-device-up IFACE=eth0) | |
stop on shutdown | |
script | |
export LOG_FILE="/home/meteor/$APP_NAME/log/upstart.log" | |
touch $LOG_FILE | |
chown $RUN_AS:$RUN_AS $LOG_FILE | |
chdir /home/meteor/$APP_NAME/builds/current | |
exec sudo -u $RUN_AS sh -c " PORT=$PORT ROOT_URL='$ROOT_URL' $NODE_BIN $SCRIPT_FILE >> $LOG_FILE 2>&1" | |
end script | |
respawn | |
respawn limit 5 60 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment