Skip to content

Instantly share code, notes, and snippets.

@chriswessels
Last active December 22, 2015 18:49

Revisions

  1. chriswessels revised this gist Sep 12, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion leaderboard.conf
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ 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'
    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"
  2. chriswessels created this gist Sep 10, 2013.
    25 changes: 25 additions & 0 deletions leaderboard.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!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'

    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