Created
October 24, 2016 11:52
-
-
Save bnhansn/2cb272b40c1999e213bd508baec9abd3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/pre/03_mute_sidekiq.sh": | |
mode: "000755" | |
content: | | |
#!/bin/bash | |
. /opt/elasticbeanstalk/support/envvars | |
PIDFILE=/var/app/containerfiles/pids/sidekiq.pid | |
if [ -f ${PIDFILE} ] | |
then | |
kill -USR1 `cat ${PIDFILE}` | |
rm -rf /var/app/containerfiles/pids/sidekiq.pid | |
fi | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh": | |
mode: "000755" | |
content: | | |
#!/bin/bash | |
initctl restart sidekiq || initctl start sidekiq | |
"/opt/elasticbeanstalk/hooks/configdeploy/pre/03_mute_sidekiq.sh": | |
mode: "000755" | |
content: | | |
#!/bin/bash | |
. /opt/elasticbeanstalk/support/envvars | |
PIDFILE=/var/app/containerfiles/pids/sidekiq.pid | |
if [ -f ${PIDFILE} ] | |
then | |
kill -USR1 `cat ${PIDFILE}` | |
rm -rf /var/app/containerfiles/pids/sidekiq.pid | |
fi | |
"/opt/elasticbeanstalk/hooks/configdeploy/post/50_restart_sidekiq.sh": | |
mode: "000755" | |
content: | | |
#!/bin/bash | |
initctl restart sidekiq || initctl start sidekiq | |
"/opt/elasticbeanstalk/hooks/restartappserver/pre/03_mute_sidekiq.sh": | |
mode: "000755" | |
content: | | |
#!/bin/bash | |
. /opt/elasticbeanstalk/support/envvars | |
PIDFILE=/var/app/containerfiles/pids/sidekiq.pid | |
if [ -f ${PIDFILE} ] | |
then | |
kill -USR1 `cat ${PIDFILE}` | |
rm -rf /var/app/containerfiles/pids/sidekiq.pid | |
fi | |
"/opt/elasticbeanstalk/hooks/restartappserver/post/50_restart_sidekiq.sh": | |
mode: "000755" | |
content: | | |
#!/bin/bash | |
initctl restart sidekiq || initctl start sidekiq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any reason you have to rimraf the sidekiq.pid?
rm -rf /var/app/containerfiles/pids/sidekiq.pid
Also, when do you run TERM?
https://github.com/mperham/sidekiq/wiki/Signals#term
Isn't convention to run the
kill -USR1
as early as possible, like you have it, but runTERM
&rm -rf sidekiq.pid
on all the post hooks?