Unicorn USR2 Hot Restart Fails in FreeBSD Jail

Posted on December 09, 2012

I run Unicorn in production for several of my Ruby applications. I recently migrated from Linux to FreeBSD and was mystified by "Address already in use" messages when trying to hot-restart Unicorn with new code deployments. I suspected this had to do with running Unicorn in a FreeBSD jail but I wasn't able to prove it until today.

What was the solution? Bind to an explicit IP/socket. I had "listen 8080" in my unicorn config. Changing that to "listen 10.1.1.4:8080" got me rolling restarts once again. This is a side-effect of being run inside a jail, the details of which are over my head.

comments powered by Disqus