Sha256: 6880fb119abbfeabb7d777dc041de8fe510dcec89989b681d4397420212c4208

Contents?: true

Size: 616 Bytes

Versions: 27

Compression:

Stored size: 616 Bytes

Contents

#!/bin/bash
export HOME=<%= deploy_to %>
export RAILS_ENV=<%= rails_env %>

if [[ -e "${HOME}"/.rvm/scripts/rvm ]]; then
  source "${HOME}"/.rvm/scripts/rvm
fi

WORKER="$1" && shift
QUEUE="$1" && shift

PIDFILE=<%= pid_path %>/resque.${WORKER}.pid
CMD="<%= rake %> environment resque:work QUEUE=${QUEUE} PIDFILE=${PIDFILE}"

cd <%= current_path %> >/dev/null

sig () {
  test -s "$PIDFILE" && kill -$1 $(<$PIDFILE)
}

case $1 in
start)
  sig 0 && echo >&2 "Already running" && exit 0
  exec $CMD
  ;;
stop)
  sig TERM && exit 0
  echo >&2 "Not running"
  ;;
*)
  echo >&2 "Usage: $0 <start|stop>"
  exit 1
  ;;
esac

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
capper-0.9.23 lib/capper/templates/resque.sh.erb
capper-0.9.22 lib/capper/templates/resque.sh.erb
capper-0.9.21 lib/capper/templates/resque.sh.erb
capper-0.9.20 lib/capper/templates/resque.sh.erb
capper-0.9.19 lib/capper/templates/resque.sh.erb
capper-0.9.18 lib/capper/templates/resque.sh.erb
capper-0.9.17 lib/capper/templates/resque.sh.erb
capper-0.9.16 lib/capper/templates/resque.sh.erb
capper-0.9.15 lib/capper/templates/resque.sh.erb
capper-0.9.14 lib/capper/templates/resque.sh.erb
capper-0.9.13 lib/capper/templates/resque.sh.erb
capper-0.9.12 lib/capper/templates/resque.sh.erb
capper-0.9.11 lib/capper/templates/resque.sh.erb
capper-0.9.10 lib/capper/templates/resque.sh.erb
capper-0.9.9 lib/capper/templates/resque.sh.erb
capper-0.9.8 lib/capper/templates/resque.sh.erb
capper-0.9.7 lib/capper/templates/resque.sh.erb
capper-0.9.6 lib/capper/templates/resque.sh.erb
capper-0.9.5 lib/capper/templates/resque.sh.erb
capper-0.9.4 lib/capper/templates/resque.sh.erb