Created
October 2, 2018 06:51
-
-
Save digitalm/8c32953cd0f075a967c8ef5f3752f530 to your computer and use it in GitHub Desktop.
stopping ステータスになった sidekiq を殺す
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
#!/bin/sh | |
# exec by cron | |
# * * * * * /home/app/cron/sidekiq-killer.sh >> /var/log/cronlog/cron.log 2>&1 | |
# if use pid, get sidekiq-0.pid | |
# PID=`cat /var/www/app/shared/tmp/pids/sidekiq-0.pid` | |
count=`ps aux | grep -v grep | grep sidekiq | grep 'busy] stopping' | wc -l` | |
pid=`ps aux | grep -v grep | grep sidekiq | grep 'busy] stopping' | awk '{print $2}'` | |
if [ $count = 1 ]; then | |
echo Killing stopping sidekiq, pid is $pid | |
kill -TERM $pid | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment