description "GOV.UK application: <%= title %>"

# ideally we'd use the "manual" stanza to disable job startup in
# development, but this stanza was only added in upstart 0.6.7 and
# lucid runs upstart 0.6.5.
<%- if @enable_service -%>
start on runlevel [2345]
<%- end -%>
stop on runlevel [!2345]

respawn

# If the app respawns more than 5 times in 20 seconds, it has deeper problems
# and should be killed off.
respawn limit 5 20

script

  <%- unless @use_unicornherder -%>
  env UNICORNHERDER=false
  export UNICORNHERDER
  <%- end -%>
  exec govuk_setenv "<%= title %>" govuk_spinup \
    >>/var/log/<%= title %>/upstart.out.log \
    2>>/var/log/<%= title %>/upstart.err.log
end script

description "GOV.UK application: <%= title %>"

# ideally we'd use the "manual" stanza to disable job startup in
# development, but this stanza was only added in upstart 0.6.7 and
# lucid runs upstart 0.6.5.
<%- if @enable_service -%>
start on runlevel [2345]
<%- end -%>
stop on runlevel [!2345]

respawn

# If the app respawns more than 5 times in 20 seconds, it has deeper problems
# and should be killed off.
respawn limit 5 20

script

  <%- if @use_unicornherder -%>
  env UNICORNHERDER=true
  <%- else -%>
  env UNICORNHERDER=false
  <%- end -%>
  export UNICORNHERDER
  exec govuk_setenv "<%= title %>" govuk_spinup \
    >>/var/log/<%= title %>/upstart.out.log \
    2>>/var/log/<%= title %>/upstart.err.log
end script

Make sure UNICORNHERDER is set
Make sure UNICORNHERDER is set
