Sha256: d135a49befdbce58aed34becda21a6a2153d6c7e8d0fbc5bfe093eb7ae549540

Contents?: true

Size: 1.83 KB

Versions: 14

Compression:

Stored size: 1.83 KB

Contents

<%
  @path = "/etc/init/resque-pool.conf"
  @backup = false
%>
description "resque pool server"

start on started redis
stop on runlevel [016]

# not available in upstart 0.6.5
# kill signal INT

script
  cd <%= Rubber.root %>
  exec sudo -u <%= rubber_env.app_user %> /bin/bash -l -c 'cd <%= Rubber.root %> && exec bundle exec resque-pool > log/resque-pool.log 2>&1'
end script

post-start script
  status resque-pool | head -n1 | awk '{print $NF}' > <%= rubber_env.resque_pool_pid_file %>
end script

# using pre-stop prevents restarts in upstart on ubuntu 10.04,
# but no choice since "kill signal" not available in that ver
# of upstart, and we need to kill INT on restart during deploy
# so that we dont end up killing running jobs
#
pre-stop script
  pid=`cat /var/run/resque-pool.pid`
  kill -INT $pid
  while ps -p $pid > /dev/null; do sleep 0.1; done
  rm -f <%= rubber_env.resque_pool_pid_file %>
end script

# The pool manager responds to the following signals:
#
# HUP - reload the config file, reload logfiles, restart all workers.
# QUIT - send QUIT to each worker parent and shutdown the manager after all workers are done.
# INT - send QUIT to each worker parent and immediately shutdown manager
# TERM - send TERM to each worker parent and immediately shutdown manager
# WINCH - send QUIT to each worker, but keep manager running (send HUP to reload config and restart workers)
# USR1/USR2/CONT - pass the signal on to all worker parents (see Resque docs).
# Use HUP to help logrotate run smoothly and to change the number of workers per worker type.
#
# Resque workers respond to a few different signals:
#
# QUIT - Wait for child to finish processing then exit
# TERM / INT - Immediately kill child then exit
# USR1 - Immediately kill child but don't exit
# USR2 - Don't start to process any new jobs
# CONT - Start to process new jobs again after a USR2

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rubber-2.0.1 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre12 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre11 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre10 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre9 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre8 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre7 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre6 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre5 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre4 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre3 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre2 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf
rubber-2.0.0.pre1 templates/resque/config/rubber/role/resque_worker/resque-pool-upstart.conf