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 -%>
<%- if @depends_on_nfs -%>
start on stopped mountall-net
<%- else -%>
start on runlevel [2345]
<%- end -%>
<%- 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

  exec govuk_setenv "<%= @title %>" govuk_spinup \
    >>/var/log/<%= @title %>/upstart.out.log \
    2>>/var/log/<%= @title %>/upstart.err.log
end script
<%- if @upstart_post_start_script -%>

post-start script
  <%= @upstart_post_start_script %>
end script
<%- end -%>

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

<%- if !@enable_service -%>
manual
<%- end -%>

<%- if @depends_on_nfs -%>
start on stopped mountall-net
<%- else -%>
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

  exec govuk_setenv "<%= @title %>" govuk_spinup \
    >>/var/log/<%= @title %>/upstart.out.log \
    2>>/var/log/<%= @title %>/upstart.err.log
end script
<%- if @upstart_post_start_script -%>

post-start script
  <%= @upstart_post_start_script %>
end script
<%- end -%>

Use the manual stanza to disable services
Use the manual stanza to disable services

- We no longer use Lucid, so `manual` is supported.
