What''s the difference, architecturally between cluster::restart and cluster::stop/start (I haven''t looked at the code, which is kinda lazy of me to ask the question I know) If they aren''t very different actually, can I put a plug in for having cluster::restart do a "start" if something''s happened and mongrel is stopped for that configuration? It appears that ::restart doesn''t start a stopped configuration, and logically to me, (or at least consistently with most process restart commands) it should. Jason -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jason Young -- Systems Engineer, eXtension http://about.extension.org/wiki/Jason_Young ______________________________________
On Tue, 2006-06-20 at 12:04 -0400, Jason Young wrote:> What''s the difference, architecturally between cluster::restart and > cluster::stop/start (I haven''t looked at the code, which is kinda > lazy of me to ask the question I know) > > If they aren''t very different actually, can I put a plug in for > having cluster::restart do a "start" if something''s happened and > mongrel is stopped for that configuration? It appears > that ::restart doesn''t start a stopped configuration, and logically > to me, (or at least consistently with most process restart commands) > it should.I''ll shoot this suggestion to Bradley and see what he thinks. For mongrel a restart is actually re-runs mongrel from a inside the same ruby interpreter, forks and then exits. This gives you a fast restart and makes sure all the current requests are done. In the case of mongrel_cluster this might get complicated. It might involve checking for PIDs and compare with what''s running, or maybe checking ports. Ruby doesn''t have good facilities for listing PIDs so it might take some shell hackery. :-) -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/
Hi Jason: On Jun 20, 2006, at 12:04 PM, Jason Young wrote:> What''s the difference, architecturally between cluster::restart and > cluster::stop/start (I haven''t looked at the code, which is kinda > lazy of me to ask the question I know) > If they aren''t very different actually, can I put a plug in for > having cluster::restart do a "start" if something''s happened and > mongrel is stopped for that configuration? It appears > that ::restart doesn''t start a stopped configuration, and logically > to me, (or at least consistently with most process restart commands) > it should.cluster::restart just calls "mongrel_rails restart" for each process in the cluster. However, the mongrel_cluster capistrano tasks and mongrel_cluster_ctl call cluster::stop then cluster::start. There are subtle issues with using cluster::restart depending on if you''ve modified your mongrel_cluster conf file (changing port, etc). I tend to favor the behavior of stop/start as its more inline with other services and avoids issues with configuration changes. I plan on digging into this a bit more next week. Thanks, Bradley Taylor ------ Rails Machine Simplified Ruby on Rails deployment http://railsmachine.com