description "GOV.UK pact broker"


start on runlevel [2345]
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
  cd <%= @deploy_dir %>/app
  exec sudo -u <%= @user %> -E \
    exec bundle exec unicorn -c unicorn.rb \
    >>/var/log/pact_broker.log \
    2>>/var/log/pact_broker.err.log
end script

description "GOV.UK pact broker"


start on runlevel [2345]
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
  cd <%= @deploy_dir %>/app
  # Using `bash -l` to pick up profile including rbenv setup
  exec sudo -u <%= @user %> \
    bash -l -c "exec bundle exec unicorn -c <%= @deploy_dir %>/unicorn.rb" \
    >>/var/log/pact_broker.log \
    2>>/var/log/pact_broker.err.log
end script

Update upstart script to work with rbenv.
Update upstart script to work with rbenv.

Using `bash -l` causes all the profile scripts to be loaded, and
therefore means that the necessary rbenv setup will be done.
