Iñaki Baz Castillo <[email protected]> wrote: > Hi, I've modified bin/unicorn to start a DRb server before last lines: > > MyApp::DRbServer.start(Process.pid) > Unicorn::Launcher.daemonize! if daemonize > Unicorn.run(app, options) > > DRb server listens in port 5555. When I send a USR2 signal to unicorn master > process I get an error because DRb is started again so: > > /usr/local/lib/ruby1.9/1.9.1/drb/drb.rb:861:in `initialize': Address already > in use - bind(2) (Errno::EADDRINUSE)
First off I really don't think you need to be using DRb for this or (generally) sticking things into the master process that don't belong there. > Is there any way to achive this? > I could imagine a new config option "on_usr2" (or "before_reexec") so the > passsed block would be executed upon receipt of USR2 (before the real > "reexec" > method). > > Does it make sense? There's already a similar before_exec hook documented in http://unicorn.bogomips.org/Unicorn/Configurator.html But it is called after forking, so the listener will be shared. But again, you don't need to use DRb for this. -- Eric Wong _______________________________________________ Unicorn mailing list - [email protected] http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
