Created
October 3, 2014 20:19
-
-
Save bobeckert/775708074e39290047aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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_backoffice 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 rvm | |
export HOME=/home/deploy | |
source /etc/profile.d/rvm.sh | |
source /srv/backoffice/shared/config/env | |
cd /srv/backoffice/current | |
exec bin/sidekiq -i ${index} -e production -C config/sidekiq.yml -P tmp/pids/sidekiq-${index}.pid | |
EOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this runs in dash
because /bin/sh is a symlink and that's important, check that /bin/sh is dash first, but pretty sure it is