# <%= label %>
# Generated by strong-service-upstart on <%= created %>

description "<%= servicedescription %>"
author "<%= author %>"

# Start on boot/reboot
start on runlevel [2345]

# Stop on shutdown/reboot
stop on runlevel [016]

# To start/stop <%= label %> service manually, run:
#
# /sbin/initctl start <%= label %>
# /sbin/initctl stop <%= label %>

respawn

# Log all service output to /var/log/<%= label %>.log
# Log rotation is handled by Upstart
console log

# User & Group to run service as:
<% if (cwd) { %>chdir <%= cwd %><% } else { %># No working directory specifed<% } %>
setuid <%= user %>
setgid <%= group %>

# Arbitrarily high limit on number of open file descriptors:
limit nofile 50000 50000

# Enable core dumps:
limit core unlimited unlimited

# Environment variables:
<% if (env && env.length > 0) {
  _.forEach(env, function(pair) {
  %>env <%- pair[0] %>=<%- pair[1] %>
<%}) } else {
  %># no environment variables set<%
} %>

# Run our actual application
exec <%= execpath %> <%= script %>
