Skip to content

Instantly share code, notes, and snippets.

@bobeckert
Created October 3, 2014 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobeckert/f7799abb645f3f3cc77d to your computer and use it in GitHub Desktop.
Save bobeckert/f7799abb645f3f3cc77d to your computer and use it in GitHub Desktop.
# /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_backoffice index=$i
done
end script
post-stop script
initctl emit --no-wait backoffice-worker-process-stopped
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment