Fantastic! This approach worked well and was easy for me to implement as my production servers run Gentoo.<br><br>Thx!<br><br>~ Ben<br><br><div><span class="gmail_quote">On 3/12/07, <b class="gmail_sendername">Ezra Zygmuntowicz
</b> <<a href="mailto:ezmobius@gmail.com">ezmobius@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br> Yeah there are some weird interactions between capistrano and some
<br>daemons, the old version of backgroundrb exibits this behavior. That<br>way I get around it is by creating an init.d script, then letting<br>capuse that to restart bdrb. Works like a charm. Here is an init.d<br>script for Gentoo systems, it should be easy to adapt to any other
<br>unixy system.:<br><br>#!/sbin/runscript<br># Copyright 1999-2004 Gentoo Foundation<br># Distributed under the terms of the GNU General Public License v2<br># $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/files/nginx-r1,v
<br>1.1 2006/07/04 16:58:38 voxus Exp $<br><br><br>depend() {<br> need net<br> use dns<br> after gfs<br>}<br>start() {<br> ebegin "Starting bdrb2"<br> RAILS_ENV=demo /data/toolbox/current/script/backgroundrb/
<br>start -d<br> eend $? "Failed to start bdrb2"<br>}<br><br>stop() {<br> ebegin "Stopping bdrb2"<br> kill -9 `cat /data/toolbox/current/log/<br>backgroundrb.pid` 2>/dev/null; true
<br> eend $? "Failed to stop bdrb2"<br>}<br><br><br><br>Cheers-<br>-Ezra<br><br><br>On Mar 12, 2007, at 10:47 AM, Ben Reubenstein wrote:<br><br>> Hello ~<br>><br>> I am using the Capistrano recipe outlined in this post to restart
<br>> my backgroundrb server:<br>><br>> <a href="http://rubyforge.org/pipermail/backgroundrb-devel/2007-February/">http://rubyforge.org/pipermail/backgroundrb-devel/2007-February/</a><br>> 000718.html<br>><br>
> My Version:<br>> ~~~~~~~~~~~~<br>> task :before_restart, :roles => :app do<br>> restart_backgroundrb<br>> end<br>><br>> task :start_backgroundrb, :roles => :app do<br>> sudo "nohup /var/www/rails/#{application}/current/script/
<br>> backgroundrb/start "<br>> end<br>><br>> task :stop_backgroundrb, :roles => :app do<br>> sudo "kill -9 `cat /var/www/rails/#{application}/current/log/<br>> backgroundrb.pid` 2>/dev/null; true"
<br>> end<br>><br>> task :restart_backgroundrb, :roles => :app do<br>> stop_backgroundrb<br>> start_backgroundrb<br>> end<br>> ~~~~~~~~~~~~<br>><br>> The backgroundrb server is stopped and started but hangs at the
<br>> start_backgroundrb task. Capistrano shows:<br>><br>> * executing task start_backgroundrb<br>> * executing "sudo nohup /var/www/rails/*************/current/<br>> script/backgroundrb/start"
<br>> servers: ["host"]<br>> [host] executing command<br>> ** [out :: host] nohup: ignoring input and appending output to<br>> `nohup.out'<br>><br>> It will hang there and not restart the main web app process. I
<br>> updated my gems to see if this was a version issue, but am<br>> experiencing the same problem. I also tried running this<br>> task :after_restart, the web app is successfully restarted, but it<br>> still hangs.
<br>><br>> Thanks in advance for any ideas on how to fix this.<br>><br>> ~ Ben<br>><br>> --<br>> Ben Reubenstein<br>> 303-947-0446<br>> <a href="http://www.benr75.com">http://www.benr75.com</a><br>
> _______________________________________________<br>> Backgroundrb-devel mailing list<br>> <a href="mailto:Backgroundrb-devel@rubyforge.org">Backgroundrb-devel@rubyforge.org</a><br>> <a href="http://rubyforge.org/mailman/listinfo/backgroundrb-devel">
http://rubyforge.org/mailman/listinfo/backgroundrb-devel</a><br><br>-- Ezra Zygmuntowicz<br>-- Lead Rails Evangelist<br>-- <a href="mailto:ez@engineyard.com">ez@engineyard.com</a><br>-- Engine Yard, Serious Rails Hosting<br>
-- (866) 518-YARD (9273)<br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Ben Reubenstein<br>303-947-0446<br><a href="http://www.benr75.com">http://www.benr75.com</a>