1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
mperham--sidekiq/examples/upstart/manage-many/sidekiq-manager.conf
Thilo Utke e99a212b1f Update sidekiq-manager.conf
changed the example service commands as upstart uses the config file name.
2013-12-10 12:57:15 +01:00

33 lines
989 B
Text

# /etc/init/sidekiq-manager.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 sidekiq-manager" to stop all Sidekiq instances.
# Use "start sidekiq-manager" to start all instances.
# Use "restart sidekiq-manager" 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 SIDEKIQ_CONF=/etc/sidekiq.conf
pre-start script
for i in `cat $SIDEKIQ_CONF`; do
app=`echo $i | cut -d , -f 1`
num_workers=`echo $i | cut -d , -f 2`
for j in `seq 0 $(($num_workers - 1))`; do
start sidekiq app=$app index=$j
done
done
end script