-
-
Save deependersingla/c23483fc11c7f3ed4478 to your computer and use it in GitHub Desktop.
This is sidekiq.config to be used with v1.0.4 almost it is same as give here: https://gist.github.com/gcarrion-gfrmedia/11396682 but you don't need to update other script and need to add two line's to create post directory as some instance don't have it
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
commands: | |
create_post_dir: | |
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post" | |
ignoreErrors: true | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq": | |
mode: "000755" | |
content: | | |
#!/bin/bash | |
. /opt/elasticbeanstalk/containerfiles/envvars | |
PIDFILE=$EB_CONFIG_APP_PIDS/sidekiq.pid | |
cd $EB_CONFIG_APP_CURRENT | |
if [ -f $PIDFILE ] | |
then | |
SIDEKIQ_LIVES=$(/bin/ps -o pid= -p `cat $PIDFILE`) | |
if [ -z $SIDEKIQ_LIVES ] | |
then | |
rm -rf $PIDFILE | |
else | |
kill -TERM `cat $PIDFILE` | |
sleep 20 | |
rm -rf $PIDFILE | |
fi | |
fi | |
BUNDLE=/usr/local/bin/bundle | |
SIDEKIQ=/usr/local/bin/sidekiq | |
$BUNDLE exec $SIDEKIQ \ | |
-e production \ | |
-P /var/app/containerfiles/pids/sidekiq.pid \ | |
-C /var/app/current/config/sidekiq.yml \ | |
-L /var/app/containerfiles/logs/sidekiq.log \ | |
-d | |
"/opt/elasticbeanstalk/hooks/appdeploy/pre/03_mute_sidekiq": | |
mode: "000755" | |
content: | | |
#!/bin/bash | |
. /opt/elasticbeanstalk/containerfiles/envvars | |
PIDFILE=$EB_CONFIG_APP_PIDS/sidekiq.pid | |
if [ -f $PIDFILE ] | |
then | |
SIDEKIQ_LIVES=$(/bin/ps -o pid= -p `cat $PIDFILE`) | |
if [ -z $SIDEKIQ_LIVES ] | |
then | |
rm -rf $PIDFILE | |
else | |
kill -USR1 `cat $PIDFILE` | |
sleep 10 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment