Unicorn does not restart using USR2

I am trying to reload the unicorn using the USR2 signal, but in the logs I get the following error:

E, [2012-04-13T21:27:00.801192 #24474] ERROR -- : old PID:23820 running with existing pid=/home/user/app.git/tmp/unicorn.pid.oldbin, refusing rexec 

I searched the internet but have no idea. Does the unicorn seem to be trying to write to the pid file? I release kill -s USR2 PID

thanks

+7
source share
1 answer

I came across this today. I assume that you previously sent the USR2 to the unicorn, and this is the second time you are trying to do this.

In the unicorn documentation on signals and USR2: "A separate QUIT should be sent to the original process as soon as the child is checked up and running."

In this particular case, you must pass the old PID in order to kill

 kill -s QUIT 23820 

Or you can take advantage of the fact that this old PID stores a known file (link in the error message) along with the "current" PID and does:

 kill -s QUIT `cat /home/user/app.git/tmp/unicorn.pid.oldbin` 
+8
source

All Articles