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

make sure sidekiq processes receive proper stop signals

This commit is contained in:
Richard Peng 2013-05-23 11:52:23 -04:00
parent f024c6079c
commit 3bedebb988

View file

@ -21,7 +21,7 @@ description "Sidekiq Background Worker"
stop on (stopping sidekiq-manager or runlevel [06])
# change apps to match your deployment user if you want to use this as a less privileged user (recommended!)
# setuid apps
# setuid apps
# setgid apps
respawn
@ -55,3 +55,30 @@ exec /bin/bash <<EOT
exec bundle exec sidekiq -i ${index} -e production -C config/sidekiq.yml -P tmp/sidekiq/${index}.pid
EOT
end script
pre-stop script
# this script runs in /bin/sh by default
# respawn as bash so we can source in rbenv
exec /bin/bash <<EOT
# uncomment to use syslog for logging
# exec &> /dev/kmsg
export HOME=/home/apps
# 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
logger -t sidekiq "Stopping process: $app-$index"
cd $app
exec bundle exec sidekiqctl stop tmp/sidekiq/${index}.pid
EOT
end script