My Bash script has the following code that doesn't throw an error.
echo "Reloading Unicorn if USR2 is enabled" kill -USR2 `cat $PID` if [ -s $OLD_PID ] then kill -WINCH `cat $OLD_PID` && kill -QUIT `cat $OLD_PID` fi ;;
The lack of error and the issuing of the new pid makes me think this works, but the old master or
$OLD_PID stays around forever. Is it normal for the old pid to stay around for a long time? I get scared and just kill the thing, but I'm finally manning up to ask this question here.
Pt 2, do you need to define USR2 in the unicorn.rb file? I remember a couple of years ago reading that, but I came back to unicorn and tried it again and it now works, i think without modifications to config.
Do you use USR2 in production and if so, did you modify your config to do something to the old pid and when to kill it?