[Twisted-web] spawning a xvfb and firefox with a timeout

Stephan schenette at gmail.com
Sat Aug 20 15:29:05 EDT 2011

I've attempted to switch out spawnProcess for subprocess.Popen


               command = "xvfb-run --auto-servernum firefox"
                args = shlex.split(command)
                #p = subprocess.Popen(args)
                #logging.debug("spawned a process: pid: %d", p.pid)
                subprocess =
reactor.spawnProcess(TimedProcessProtocol(20), args[0], args)

                logging.debug("spawned a process: pid: %d", subprocess.pid)

when using subprocess.Popen, xvfb does start up correctly, but then I
have a python issue which is that xfb will start firefox-bin and make
it the parent and exit, thus, making it hard to kill the new process
of which I don't know the pid of.

in any case, I'd like to use spawnProcess, so any help as to why this
isn't working would be helpful.


On Sat, Aug 20, 2011 at 10:52 AM, Stephan <schenette at gmail.com> wrote:
> Hi Glyph,
> I've created a specially crafted runnable example
> you can find it here: http://pastebin.com/dyhTFPjM
> as you'll see in the debug log that is created:
> 2011-08-20 10:36:10,484 DEBUG:errReceived xvfb-run: error: Xvfb failed to start
> 2011-08-20 10:36:10,486 DEBUG:inConnectionLost
> 2011-08-20 10:36:10,486 DEBUG:errConnectionLost
> 2011-08-20 10:36:10,487 DEBUG:process exited, status 1
> Any help is appreciated.
> to install xvfb on linux if not already installed
> sudo apt-get install xvfb
> On Fri, Aug 19, 2011 at 1:22 AM, Glyph Lefkowitz
> <glyph at twistedmatrix.com> wrote:
>> On Aug 19, 2011, at 1:14 AM, Stephan wrote:
>> Thanks for the prompt reply response inline. I'm still having issues
>> even though I've changed some code based on your advice.
>> Perhaps you could reduce this to a complete, runnable example so that
>> someone could reproduce the behavior you're seeing.  At this point further
>> advice would be guessing on my part.
>> _______________________________________________
>> Twisted-web mailing list
>> Twisted-web at twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

More information about the Twisted-web mailing list