Unicorn_rails ignores USR2 signal

Yeung, Jeffrey Jeffrey.Yeung at polycom.com
Fri Mar 9 21:48:26 UTC 2012


I have a problem with one of my Rails servers where the daemonized unicorn_rails master seems to completely ignores the USR2 signal (only).

First, about the environment.  I've searched for solutions to this problem for several day now, and my situation appears to differ from most in that my environment is not using RVM, bundler, Capistrano, or other sandboxing tools.  It's a fairly plain jane Rails deployment.  The OS is 64-bit Ubuntu 10.04 server.

 $ uname -a
 Linux 2.6.32-37-server #81-Ubuntu SMP Fri Dec 2 20:49:12 UTC 2011 x86_64 GNU/Linux
 $ lsb_release -a
 No LSB modules are available.
 Distributor ID: Ubuntu
 Description:    Ubuntu 10.04.4 LTS
 Release:        10.04
 Codename:       lucid
 $ ruby -v
 ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux]

The Rails gem version is 2.3.14.  Unicorn gem version 4.2.0.

The Unicorn config includes "preload_app true".  We use the same Unicorn configs on similar servers and for some yet unknown reason, this one is seeing a problem with USR2.

I have done my best to debug it using strace and the stderr logs.  The unicorn_rails master process handles HUP, QUIT, and USR1 signals as expected, no problems.  However, the USR2 signal is being completely ignored.

I added a before_exec block in the Unicorn conf with some puts statements, but this hook never gets called (unlike the before_fork and after_fork hooks, which are working fine for me).

 before_exec do |server|
   $stderr.puts("DEBUG before_exec")

While monitoring the master with strace, there are no calls observed when sending a kill -USR2.  Nothing is logged to STDERR when sending this signal, either.

This has me completely stymied with the lack of logging info.  Does anyone have any clues that can point me in the right direction?


More information about the mongrel-unicorn mailing list