Skip to content

Instantly share code, notes, and snippets.

@chriswessels
Last active December 22, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriswessels/6515635 to your computer and use it in GitHub Desktop.
Save chriswessels/6515635 to your computer and use it in GitHub Desktop.
#!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