From: Andreas Schwarz Date: 2007-03-05T06:33:09+09:00 Subject: Re: Strange interference between LSAPI, popen3 and MySQL Ara wrote: > On Mon, 5 Mar 2007, Andreas Schwarz wrote: > >>> def fork *a, &b >> executed. Any ideas? > hmmm. no. must be related though. i'm staring to thinks it's lsapi > which has > setup all the funky at_exit handlers, and that this is causing you > grief... I grepped for at_exit in the LSAPI source code, but didn't find anything. Maybe it's the stdout/stderr/stdin redirection stuff... >> Who would have thought that simply calling an external program could be >> so difficult... > > me ;-) > > ultimately, in ruby queue, i had to setup a drb process before setting > up db > connections. then i used that drb process to do all forking/waiting for > me. > > here's another idea, try systemu, it does not use fork at all > > gem install systemu > > http://rubyforge.org/frs/?group_id=1024&release_id=7721 > http://codeforpeople.com/lib/ruby/systemu/systemu-1.0.0/README It seems to use popen, isn't this based on fork, too? The reason I want to use popen3 is not that I need stdin/stderr, but that there is a clean way to pass arguments without having to build a command line (potential escaping problems etc.). -- Posted via http://www.ruby-forum.com/.