From: James Dinkel Date: 2008-09-27T01:19:10+09:00 Subject: popen3 mysteriously hangs I'm having a problem with a popen3 inexplicably hanging. I'm trying to run the rpmbuild command to automate compiling some srpms, as you'll see below. For most srpms, the script runs through just fine. Here's the relevant popen3 block: -------------------------- Open3.popen3("rpmbuild --rebuild GConf2-2.14.0-9.el5.src.rpm") do |stdin, stdout, stderr| if stderr.read.split($/)[-1] == '+ exit 0' success = true output_files = get_output_files(stdout.read) end end -------------------------- This is on RedHat Enterprise Linux 5.0, using ruby 1.8.5 (2006-08-25). I've ran "rpmbuild --rebuild GConf2-2.14.0-9.el5.src.rpm" directly from the command line and it completes just fine in about 2 minutes. A couple notes, "GConf2-2.14.0-9.el5.src.rpm" would normally be filled in by a variable, but GConf2-2.14.0-9.el5.src.rpm is one of the srpms that hang the system. Also, get_output_files() is my own method which I would suspect as hanging, but binaries from the rpmbuild are never created, so it must never even make to that point. Any help troubleshooting this would be appreciated, or maybe someone knows of a better way to run this command and capture stdout and stderr. Thanks, James -- Posted via http://www.ruby-forum.com/.