Erza,<br><br>I am on Centos and bash, Rails 1.2.2, Ruby 1.8.4, BackgrounDrb old version (the 0.1.x version right before 0.2...&nbsp; Is the depend() section peculiar only to Gentoo?&nbsp; If not, anything one needs to do for this?<br>
<br>I wrote a script just similar to this (w/o paying attention to the depend() section) and have capistrano before_restart task invoke the &quot;/etc/init.d/backgroundrbd restart&quot; (which is just stop and then start).&nbsp; However, this problem of backgroundrb&#39;s exiting after cap task&#39;s successful completion occurs (yes, no hanging in cap&#39;s process, but backgroundrb quits even though it is started in -d mode; the pid log file is there, but the process is no longer).&nbsp; Prepending with &quot;nohup&quot; in start seems to work, but I thought by using 
init.d style, one needn&#39;t worry about the nohup problem, either.&nbsp; Any insight?&nbsp; (Or is this a 0.1.x problem?)<br><br>Thanks,<br>Philip<br><br><div><span class="gmail_quote">On 3/12/07, <b class="gmail_sendername">Ezra Zygmuntowicz
</b> &lt;<a href="mailto:ezmobius@gmail.com">ezmobius@gmail.com</a>&gt; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; need net<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; use dns<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; after gfs<br>}<br>start() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ebegin &quot;Starting bdrb2&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RAILS_ENV=demo /data/toolbox/current/script/backgroundrb/
<br>start -d<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eend $? &quot;Failed to start bdrb2&quot;<br>}<br><br>stop() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ebegin &quot;Stopping bdrb2&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kill -9 `cat /data/toolbox/current/log/<br>backgroundrb.pid` 2&gt;/dev/null; true
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eend $? &quot;Failed to stop bdrb2&quot;<br>}<br><br><br><br>Cheers-<br>-Ezra<br><br><br>On Mar 12, 2007, at 10:47 AM, Ben Reubenstein wrote:<br><br>&gt; Hello ~<br>&gt;<br>&gt; I am using the Capistrano recipe outlined in this post to restart
<br>&gt; my backgroundrb server:<br>&gt;<br>&gt; <a href="http://rubyforge.org/pipermail/backgroundrb-devel/2007-February/">http://rubyforge.org/pipermail/backgroundrb-devel/2007-February/</a><br>&gt; 000718.html<br>&gt;<br>
&gt; My Version:<br>&gt; ~~~~~~~~~~~~<br>&gt; task :before_restart, :roles =&gt; :app do<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;restart_backgroundrb<br>&gt; end<br>&gt;<br>&gt; task :start_backgroundrb, :roles =&gt; :app do<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;sudo &quot;nohup /var/www/rails/#{application}/current/script/
<br>&gt; backgroundrb/start &quot;<br>&gt; end<br>&gt;<br>&gt; task :stop_backgroundrb, :roles =&gt; :app do<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;sudo &quot;kill -9 `cat /var/www/rails/#{application}/current/log/<br>&gt; backgroundrb.pid` 2&gt;/dev/null; true&quot;
<br>&gt; end<br>&gt;<br>&gt; task :restart_backgroundrb, :roles =&gt; :app do<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;stop_backgroundrb<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;start_backgroundrb<br>&gt; end<br>&gt; ~~~~~~~~~~~~<br>&gt;<br>&gt; The backgroundrb server is stopped and started but hangs at the
<br>&gt; start_backgroundrb task.&nbsp;&nbsp;Capistrano shows:<br>&gt;<br>&gt;&nbsp;&nbsp; * executing task start_backgroundrb<br>&gt;&nbsp;&nbsp; * executing &quot;sudo&nbsp;&nbsp;nohup /var/www/rails/*************/current/<br>&gt; script/backgroundrb/start&quot;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; servers: [&quot;host&quot;]<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; [host] executing command<br>&gt;&nbsp;&nbsp;** [out :: host] nohup: ignoring input and appending output to<br>&gt; `nohup.out&#39;<br>&gt;<br>&gt; It will hang there and not restart the main web app process.&nbsp;&nbsp;I
<br>&gt; updated my gems to see if this was a version issue, but am<br>&gt; experiencing the same problem.&nbsp;&nbsp;I also tried running this<br>&gt; task :after_restart, the web app is successfully restarted, but it<br>&gt; still hangs.
<br>&gt;<br>&gt; Thanks in advance for any ideas on how to fix this.<br>&gt;<br>&gt; ~ Ben<br>&gt;<br>&gt; --<br>&gt; Ben Reubenstein<br>&gt; 303-947-0446<br>&gt; <a href="http://www.benr75.com">http://www.benr75.com</a><br>
&gt; _______________________________________________<br>&gt; Backgroundrb-devel mailing list<br>&gt; <a href="mailto:Backgroundrb-devel@rubyforge.org">Backgroundrb-devel@rubyforge.org</a><br>&gt; <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>_______________________________________________<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></blockquote></div><br>