Running into an odd issue w/ switchtower -- everything works great, except that I''ve got one task that hangs at the end. The remote execution (starting up lighttpd) works fine, the process is actually started, and then switchtower hangs, as though it''s waiting on the channel for something. I''ve added an && echo "foo" to the run command, to confirm that it''s not the start of lighttpd that hangs, and I get the "foo" on the channel, but then it still hangs. Can''t figure out why this particular task would hang, when everything else works just fine. Any ideas?
Are you running on a Mac? If so, are you running with the stock Ruby install? If so, that''s the problem. The Ruby OpenSSL that ships with the stock Ruby install is borked. If you reinstall Ruby (via darwinports, or whatever), it should work fine. - Jamis On Sep 30, 2005, at 2:59 AM, Michael Schoen wrote:> Running into an odd issue w/ switchtower -- everything works great, > except that I''ve got one task that hangs at the end. The remote > execution (starting up lighttpd) works fine, the process is > actually started, and then switchtower hangs, as though it''s > waiting on the channel for something. > > I''ve added an && echo "foo" to the run command, to confirm that > it''s not the start of lighttpd that hangs, and I get the "foo" on > the channel, but then it still hangs. > > Can''t figure out why this particular task would hang, when > everything else works just fine. > > Any ideas? > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Jamis Buck wrote:> Are you running on a Mac?No, I''m running Debian linux. Odd thing is that I''ve been running 8 other tasks, all of which seem fine. Only thing that occurs to me is that this is the only task that kicks off a daemon process -- could Net::SSH be waiting for that process to end before closing the channel?
On Sep 30, 2005, at 9:44 AM, Michael Schoen wrote:> Jamis Buck wrote: > >> Are you running on a Mac? >> > > No, I''m running Debian linux. Odd thing is that I''ve been running 8 > other tasks, all of which seem fine. > > Only thing that occurs to me is that this is the only task that > kicks off a daemon process -- could Net::SSH be waiting for that > process to end before closing the channel?That could be... how are you launching the process in the task? - Jamis
>> Only thing that occurs to me is that this is the only task that kicks >> off a daemon process -- could Net::SSH be waiting for that process to >> end before closing the channel? > > That could be... how are you launching the process in the task?Ah, it seems to be an scgi issue (copying Zed). Not entirely sure why. My switchtower task looks like: desc "Restart the SCGI processes on the app servers." task :restart, :roles => :app do run <<-CMD cd #{current_path} && . config/shell_env.sh && rake RAILS_ENV=production scgi_start CMD end and the rake task looks like: desc "Start scgi processes" task :scgi_start => :env do puts "Starting scgi..." system "script/scgi_rails start -f log/scgi.pid" end It seems that though scgi_rails is starting the children properly, it''s not fully detached. I have found a workaround (below), which is to change the task to run scgi_rails w/ nohup and in the background. This makes it a bit funky though, so if there''s a way to fix this w/in scgi_rails it would be cleaner. desc "Start scgi processes" task :scgi_start => :env do puts "Starting scgi..." system "nohup script/scgi_rails start -f log/scgi.pid >>log/scgi.log 2>>log/scgi.log &" end