Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save caspg/2bdeee6a9d3a29e14da4c1dfb84d1192 to your computer and use it in GitHub Desktop.
Save caspg/2bdeee6a9d3a29e14da4c1dfb84d1192 to your computer and use it in GitHub Desktop.

Revisions

  1. @hubertursua hubertursua renamed this gist Dec 9, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @hubertursua hubertursua created this gist Dec 9, 2014.
    25 changes: 25 additions & 0 deletions myapp.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!upstart

    start on filesystem and started networking
    stop on shutdown

    expect fork

    setuid ubuntu
    env HOME="/home/ubuntu"

    env NODE_ENV="production"
    env MIN_UPTIME="5000"
    env SPIN_SLEEP_TIME="2000"

    chdir /home/ubuntu/myapp
    env APP_EXEC="bin/www"
    env UID="myapp"

    script
    exec forever --uid="$UID" -a --minUptime=$MIN_UPTIME --spinSleepTime=$SPIN_SLEEP_TIME start $APP_EXEC
    end script

    pre-stop script
    exec forever stop "$UID"
    end script