start on starting <%= app %>-<%= name %>
stop on stopping <%= app %>-<%= name %>
respawn
respawn limit 50 5

exec su - <%= user %> -c 'cd <%= engine.root %>; export PORT=<%= port %>;<% engine.env.each_pair do |var,env| %> export <%= var.upcase %>="<%= env %>"; <% end %> export TMPDIR=$TMPDIR/<%= app %>/<%= name %>/<%= num %>; rm -rf $TMPDIR; mkdir -p $TMPDIR; source $VENV/bin/activate; <%= process.command %> >> <%= log %>/<%=name%>-<%=num%>.log 2>&1'

start on starting <%= app %>-<%= name %>
stop on stopping <%= app %>-<%= name %>
respawn
respawn limit 50 5

exec su - <%= user %> -c 'cd <%= engine.root %>; export PORT=<%= port %>;<% engine.env.each_pair do |var,env| %> export <%= var.upcase %>='\''<%= env %>'\''; <% end %> export TMPDIR=$TMPDIR/<%= app %>/<%= name %>/<%= num %>; rm -rf $TMPDIR; mkdir -p $TMPDIR; source $VENV/bin/activate; <%= process.command %> >> <%= log %>/<%=name%>-<%=num%>.log 2>&1'

Add better string escaping to upstart template just in case somebody has an exclamation point in a Django key or something.
Add better string escaping to upstart template just in case somebody has an exclamation point in a Django key or something.
