Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unicorn not reloading with USR2

I'm trying to reload unicorn with a USR2 signal, but I get the following error on the logs:

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've search the internets but don't have a clue. It seems that unicorn is trying to write to the pid file? I'm issuing a kill -s USR2 PID

Thanks

like image 671
Miguel Ping Avatar asked Apr 13 '12 21:04

Miguel Ping


1 Answers

I ran into this today. I'm assuming you have previously sent USR2 to unicorn, and this is now the second time you're trying to do so.

Per the unicorn documentation on signals and USR2: "A separate QUIT should be sent to the original process once the child is verified to be up and running."

In this particular case, you'd pass the old PID to kill

kill -s QUIT 23820

Or, you can take advantage of the fact this old PID is stored a known file (referenced in your error message) alongside the "current" PID, and execute:

kill -s QUIT `cat /home/user/app.git/tmp/unicorn.pid.oldbin`
like image 122
Dan Jackson Avatar answered Sep 28 '22 15:09

Dan Jackson