Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

TLDR: This blog has a cool unicorn based gist that helps with creating the file and resetting the unicorn with USR2.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.