1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Pull in latest clymb upstart config for example

This commit is contained in:
Mike Perham 2013-02-18 21:19:14 -08:00
parent 7d96cc32fa
commit 82abcb02d9
3 changed files with 76 additions and 39 deletions

View file

@ -1,39 +0,0 @@
# /etc/init/sidekiq.conf - Sidekiq config
# This example config should work with Ubuntu 12.04+
#
# Save this config as /etc/init/sidekiq.conf then mange sidekiq with:
# sudo start sidekiq
# sudo stop sidekiq
# sudo status sidekiq
#
# or use the service command:
# sudo service sidekiq {start,stop,restart,status}
#
# This is the exact script used to manage Sidekiq on TheClymb.com
#
description "Sidekiq Background Worker System"
start on runlevel [2345]
stop on shutdown
setuid deploy
setgid deploy
respawn
respawn limit 3 30
script
# this script runs in /bin/sh by default
# respawn as bash so we can source in rbenv
exec /bin/bash <<EOT
# use syslog for logging
exec >/dev/kmsg 2>&1
# pull in system rbenv
source /etc/profile.d/rbenv.sh
cd /opt/theclymb/current
exec bin/sidekiq -e production -C config/sidekiq.yml -P tmp/pids/sidekiq.pid
EOT
end script

View file

@ -0,0 +1,46 @@
# /etc/init/sidekiq.conf - Sidekiq config
# This example config should work with Ubuntu 12.04+. It
# allows you to manage multiple Sidekiq instances with
# Upstart, Ubuntu's native service management tool.
#
# See workers.conf for how to manage all Sidekiq instances at once.
#
# Save this config as /etc/init/sidekiq.conf then mange sidekiq with:
# sudo start sidekiq index=0
# sudo stop sidekiq index=0
# sudo status sidekiq index=0
#
# or use the service command:
# sudo service sidekiq {start,stop,restart,status}
#
description "Sidekiq Background Worker"
# no "start on", we don't want to automatically start
stop on (stopping workers or runlevel [06])
# change to match your deployment user
setuid deploy
setgid deploy
respawn
respawn limit 3 30
instance $index
script
# this script runs in /bin/sh by default
# respawn as bash so we can source in rbenv
exec /bin/bash <<EOT
# use syslog for logging
exec &> /dev/kmsg
# pull in system rbenv
export HOME=/home/deploy
source /etc/profile.d/rbenv.sh
cd /opt/theclymb/current
exec bin/sidekiq -i ${index} -e production -C config/sidekiq.yml -P tmp/pids/sidekiq-${index}.pid
EOT
end script

View file

@ -0,0 +1,30 @@
# /etc/init/workers.conf - manage a set of Sidekiqs
# This example config should work with Ubuntu 12.04+. It
# allows you to manage multiple Sidekiq instances with
# Upstart, Ubuntu's native service management tool.
#
# See sidekiq.conf for how to manage a single Sidekiq instance.
#
# Use "stop workers" to stop all Sidekiq instances.
# Use "start workers" to start all instances.
# Use "restart workers" to restart all instances.
# Crazy, right?
#
description "manages the set of sidekiq processes"
# This starts upon bootup and stops on shutdown
start on runlevel [2345]
stop on runlevel [06]
# Set this to the number of Sidekiq processes you want
# to run on this machine
env NUM_WORKERS=2
pre-start script
for i in `seq 0 $((${NUM_WORKERS} - 1))`
do
start sidekiq index=$i
done
end script