2013-02-19 00:19:14 -05:00
|
|
|
# /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"
|
|
|
|
|
2015-04-02 09:24:13 -04:00
|
|
|
# This starts upon bootup and stops on shutdown
|
|
|
|
start on runlevel [2345]
|
|
|
|
stop on runlevel [06]
|
2013-02-19 00:19:14 -05:00
|
|
|
|
|
|
|
# change to match your deployment user
|
2014-11-10 15:06:32 -05:00
|
|
|
# setuid deploy
|
|
|
|
# setgid deploy
|
|
|
|
# env HOME=/home/deploy
|
2013-02-19 00:19:14 -05:00
|
|
|
|
|
|
|
respawn
|
|
|
|
respawn limit 3 30
|
|
|
|
|
2014-11-10 12:40:47 -05:00
|
|
|
# TERM is sent by sidekiqctl when stopping sidekiq. Without declaring these as
|
|
|
|
# normal exit codes, it just respawns.
|
2014-07-28 16:50:47 -04:00
|
|
|
normal exit 0 TERM
|
2013-10-03 14:18:05 -04:00
|
|
|
|
2013-02-19 00:19:14 -05:00
|
|
|
instance $index
|
|
|
|
|
|
|
|
script
|
|
|
|
# this script runs in /bin/sh by default
|
|
|
|
# respawn as bash so we can source in rbenv
|
2014-10-19 18:03:36 -04:00
|
|
|
exec /bin/bash <<'EOT'
|
2014-11-10 15:06:32 -05:00
|
|
|
# Pick your poison :) Or none if you're using a system wide installed Ruby.
|
|
|
|
# rbenv
|
|
|
|
# source /home/apps/.bash_profile
|
|
|
|
# OR
|
|
|
|
# source /home/apps/.profile
|
|
|
|
# OR system:
|
|
|
|
# source /etc/profile.d/rbenv.sh
|
|
|
|
#
|
|
|
|
# rvm
|
|
|
|
# source /home/apps/.rvm/scripts/rvm
|
|
|
|
|
|
|
|
# Logs out to /var/log/upstart/sidekiq.log by default
|
|
|
|
|
|
|
|
cd /var/www/app
|
|
|
|
exec bin/sidekiq -i ${index} -e production
|
2013-02-19 00:19:14 -05:00
|
|
|
EOT
|
|
|
|
end script
|